Closed bentalgad closed 6 years ago
See https://github.com/metafizzy/flickity/issues/429#issuecomment-411753543
autoPlay is designed to stop and stay stopped any time the user interacts with the carousel. This gives user control and does not take it away from the user. On mobile, there is no hover event so there is no way to detect when a cursor has exited the carousel.
That said, some developers still would like a way to resume autoPlay after being stopped for a period of time. If you wish to implement that behavior, you can do so with your own JS and the Flickity API.
Here is one solution that will always resume after being stopped for 3 seconds 🚨 even if the user has interacted with the carousel 🚨
// overwrite stopPlayer method
Flickity.prototype.stopPlayer = function() {
this.player[ action ]();
// always resume play after 3 seconds
setTimeout( () => {
this.player.play();
}, 3000 )
};
Thanks. i see your point. and thanks for the snippet also. i will rethink and implement :)
Is it possible to have the autoplay resume, if the user pressed navigation and then didn't press anything for a few seconds?