Hi,
I've just been setting up a test installation and have it working just fine - it's very easy, and just what I need.
I have a slightly odd scenario though in that I want to dynamically set the autoplaySpeed for each slide (or perhaps turn off autoplay and trigger the next slide with a custom delay another way?)
As an example, say I have ten images for today, five tomorrow, and four the next day. I want each day to run for ten seconds, so I want to put an autoplaySpeed: 1000 for the first ten images, then 2000, then 2500 and so on.
Can you give me any pointers as to whether this might be possible, and how?
Many thanks
Apologies, I just found https://github.com/kenwheeler/slick/issues/1448 and that might be what I am after. I'll investigate tomorrow and if so, close this issue
Hi'
Did you manage to find the best solution? I saw this, but i must say that it's kinda a messy fix. Taking a look at this, it does almost what i wanted to do, but the best will be, if i was able to follow a data-field like the first suggestion.
Update:
This is the code i'm currently using, grapping the slide-time from a data-attribute.
// Slick slider
var $s = $(".container-fluid");
$s.slick({
dots: true,
dotsClass: "nav-dots",
draggable: false,
swipe: false,
touchMove: false,
useTransform: false,
edgeFriction: 0,
arrows: false,
accessibility: false,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
speed:0,
autoplay: true,
autoplaySpeed: 5000,
customPaging: function(slider, i) {
var title = $(slider.$slides[i]).data('title');
return '<small>'+title+'</small>';
},
})
.on("afterChange", function(e, slick) {
slideTime = $('div[data-slick-index="'+ slick.currentSlide + '"]').data("time");
$s.slick("setOption", "autoplaySpeed", slideTime);
});
@exetico nice!
Most helpful comment
Hi'
Did you manage to find the best solution? I saw this, but i must say that it's kinda a messy fix. Taking a look at this, it does almost what i wanted to do, but the best will be, if i was able to follow a data-field like the first suggestion.
Update:
This is the code i'm currently using, grapping the slide-time from a data-attribute.