Skip to content

Instantly share code, notes, and snippets.

@AlxPle
Last active February 28, 2023 20:53
Show Gist options
  • Select an option

  • Save AlxPle/baae1aded22a615d1273d7239e16f8d5 to your computer and use it in GitHub Desktop.

Select an option

Save AlxPle/baae1aded22a615d1273d7239e16f8d5 to your computer and use it in GitHub Desktop.
Stop/Star autoplay SwiperJS on mouse events
mainPageSlider.addEventListener("mouseenter", function (e) {
myMainPageSlider.params.autoplay.disableOnInteraction = false;
myMainPageSlider.params.autoplay.delay = 5000;
myMainPageSlider.autoplay.stop();
});
mainPageSlider.addEventListener("mouseleave", function (e) {
myMainPageSlider.autoplay.start();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment