Created
August 4, 2017 18:54
-
-
Save kcclemo/33891a772b92c39b41f16c3068265c3f to your computer and use it in GitHub Desktop.
This file contains 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
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