Skip to content

Instantly share code, notes, and snippets.

@mkk360
Created November 6, 2023 08:05
Show Gist options
  • Select an option

  • Save mkk360/f0c629afde7657535a6c4f29c1e8b567 to your computer and use it in GitHub Desktop.

Select an option

Save mkk360/f0c629afde7657535a6c4f29c1e8b567 to your computer and use it in GitHub Desktop.
swiper autoplay stop on mouseenter start
// Stop the autoplay initially
swiper.autoplay.stop();
// Add mouseenter and mouseleave event handlers to start and stop the autoplay
$(this).on('mouseenter', function () {
swiper.autoplay.start();
}).on('mouseleave', function () {
swiper.autoplay.stop();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment