Skip to content

Instantly share code, notes, and snippets.

@kcclemo
Created August 4, 2017 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kcclemo/33891a772b92c39b41f16c3068265c3f to your computer and use it in GitHub Desktop.
Save kcclemo/33891a772b92c39b41f16c3068265c3f to your computer and use it in GitHub Desktop.
var pauseState = true;
// On before slide change
slider.on('afterChange', function(event, slick, currentSlide, nextSlide){
//check the length of total items in .gallery container
//if that number is the same with the number of the last slider
//Then pause the slider
if( item_length === slider.slick('slickCurrentSlide') ){
$('#pause-btn').toggle();
$('#play-btn').toggle();
$('.gallery').slick('slickPause');
$(pauseState = true);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment