I want to "sync" the slider based on some passed date. For example: I have slides with identifier 1, 2, 5. So I add <div id="slide-id-1">...</div> respectively for every ID.
Now, I get some other data: 1, 2, 4. So I have to remove slide with ID 5. My first thought is to iterate through every slide based on their index and then call slick('removeSlide' index). However, I can't find in the docs a method to get the count of slides.
How can I get this?
I'm also very interested in this.
Couldn't seem to get this either. Assuming by the number of issues/PR's not sure if even adding this to the API is worth it
Frustratingly, this appears to have been a method in the past but was removed somewhere along the line - https://github.com/kenwheeler/slick/issues/1219
Not sure if this is exactly what you're after, but I can get the number of slides like this:
$(".mySlider").on("init", function (event, slick) {
var numSlides = slick.slideCount;
console.log(numSlides);
});
Not sure if this is exactly what you're after, but I can get the number of slides like this:
$(".mySlider").on("init", function (event, slick) { var numSlides = slick.slideCount; console.log(numSlides); });
Thanks for property name slideCount. Now I can get the number of slides with this.
$('#slick').slick('getSlick').slideCount
Most helpful comment
I'm also very interested in this.