Last active
February 28, 2023 20:53
-
-
Save 2thecrow/baae1aded22a615d1273d7239e16f8d5 to your computer and use it in GitHub Desktop.
Stop/Star autoplay SwiperJS on mouse events
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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