-
-
Save sukhikh18/52c85152233cc792610471a678237888 to your computer and use it in GitHub Desktop.
slick slide count and all slides
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
var $slider = $('.slider'), | |
$current = $('<span class="current">'), | |
$summary = $('<span class="summary">'); | |
$slider | |
.on('init', function(event, slick) { | |
$current.html(1); | |
$summary.html(slick.slideCount); | |
$('.slick-dots') | |
.wrap('<div class="info">') | |
.before($current) | |
.after($summary); | |
}) | |
.on('afterChange', function(event, slick, currentSlide, nextSlide) { | |
$current.html(currentSlide + 1); | |
}) | |
.slick(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment