I think this is a bug unless I’m miss-interpreting what timer delay for the slider does.
If you set the timer delay to something below the duration of the slide then the slider freaks out.
In my example I’m trying to get images to scroll across the screen in a infinite loop. The first slider works almost perfectly. Though there are issues with how the first slide blinks in.
The second slider is exactly the same the only difference is that the timer delay is set to zero.
If that’s not that way to set the slider to simply start scrolling immediately then what is?
Well I can see what you are doing here. Unfortunately, the slider auto-animate will stop as soon as the user clicks or taps on them. So, even if this is fixed, you might still want to implement another custom slider library.
if (isAttrTrue(data.el.attr('data-autoplay'))) {
config.autoplay = true;
config.delay = parseInt(data.el.attr('data-delay'), 10) || 2000;
config.timerMax = parseInt(data.el.attr('data-autoplay-limit'), 10);
// Disable timer on first touch or mouse down
var touchEvents = 'mousedown' + namespace + ' touchstart' + namespace;
if (!designer) {
data.el.off(touchEvents).one(touchEvents, function() {
stopTimer(data);
});
}
}
Here is the code that tries to make the slider autoscroll infinitely:
This code runs the slider next function, which runs the change function:
window.setTimeout(function() {
if (data.timerId == null || designer) return;
next(data)();
startTimer(data);
}, config.delay); // <- Here delay setting is used