Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active January 21, 2021 10:31
Show Gist options
  • Select an option

  • Save wplit/11ee75e794378f3e877a6167904739f8 to your computer and use it in GitHub Desktop.

Select an option

Save wplit/11ee75e794378f3e877a6167904739f8 to your computer and use it in GitHub Desktop.
pause autoplay after clicking prev/next for a time, then resume play
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