Created
November 6, 2023 08:05
-
-
Save mkk360/f0c629afde7657535a6c4f29c1e8b567 to your computer and use it in GitHub Desktop.
swiper autoplay stop on mouseenter start
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
| // 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