Splide: resume autoplay not firing
5ulo opened this issue · 1 comments
5ulo commented
Pause is working, resuming to play not working.
https://accessible360.github.io/accessible-carousel-boilerplates/Splide/hero-banner.html
The problem is in the function toggleAutoplay()
where you look for splide option autoplay, which always returns true
. You have to overide this option in if
statement. See example bellow.
function toggleAutoplay() {
var autoplayEnabled = splide.options.autoplay;
if (autoplayEnabled) {
disableAutoplay();
splide.options = { autoplay: false }; // <-- this is missing
} else {
enableAutoplay();
splide.options = { autoplay: true }; // <-- this is missing
}
}