Last active
January 21, 2021 10:31
-
-
Save wplit/11ee75e794378f3e877a6167904739f8 to your computer and use it in GitHub Desktop.
pause autoplay after clicking prev/next for a time, then resume play
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
| jQuery(document).ready(function($) { | |
| let $carousel = $('#%%ELEMENT_ID%%').find($('#%%ELEMENT_ID%%').children().data('carousel')); | |
| $('#%%ELEMENT_ID%%').find('.oxy-carousel-builder_icon').on( 'click', pauseUnpause ); | |
| function pauseUnpause() { | |
| $carousel.flickity('pausePlayer'); | |
| setTimeout(() => $carousel.flickity('unpausePlayer'), 1000); // resume after 1000ms | |
| }; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment