Created
March 27, 2020 01:41
-
-
Save smallpirate/bde4aef4a3df7c4d6248eabb79d1218a 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 $status = $('.slide-count'); | |
var $slickElement = $('.slideshow', this); | |
$slickElement.on('init reInit afterChange', function (event, slick, currentSlide, nextSlide) { | |
//currentSlide is undefined on init -- set it to 0 in this case (currentSlide is 0 based) | |
if(!slick.$dots){ | |
return; | |
} | |
var i = (currentSlide ? currentSlide : 0) + 1; | |
$status.html(i + '<div>/' + (slick.$dots[0].children.length) + '</div>' ); | |
}); | |
$slickElement.slick({ | |
autoplay: false, | |
dots: true, | |
arrows: true, | |
speed: 500, | |
prevArrow: '<span class="slick-prev"></span>', | |
nextArrow: '<span class="slick-next"></span>', | |
appendArrows: '.arrows-slider' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment