slick: Pause on hover not working without options.autoplay = true
When initialize slick without autoplay: true and start it by calling element.slickPlay(). Hover over slick doe not pause it animation.
Though it’s related with following code:
Slick.prototype.initDotEvents = function() {
var _ = this;
if (_.options.dots === true && _.slideCount > _.options.slidesToShow) {
$('li', _.$dots).on('click.slick', {
message: 'index'
}, _.changeSlide);
}
if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.options.autoplay === true) {
$('li', _.$dots)
.on('mouseenter.slick', function(){
_.paused = true;
_.autoPlayClear();
})
.on('mouseleave.slick', function(){
_.paused = false;
_.autoPlay();
});
}
};
It’s subscribe hover events only if slick is initialized with _.options.autoplay === true
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (3 by maintainers)
Commits related to this issue
- [ autoplay revamp ] - clean up autoplay handling - new option: `pauseOnFocus` (bool) - new states: `paused`, `interrupted`, `focussed` There were many open PRs and issues with autoplay. the main prob... — committed to simeydotme/slick by simeydotme 8 years ago
- Properly addresses #908 - when carousel initialises with autoplay off, but pauseOnHover to true, then calls `play` ; now it correctly allows `pauseOnHover` — committed to kenwheeler/slick by simeydotme 8 years ago
I have some issues like when autoplaySpeed is Zero but on pauseOnHover not working it takes time to stop slide
Anyone ever figures out a solution to this? I love the continuous scrolling, just hate the weird pause on hover delay. I have put them my code here. https://github.com/kenwheeler/slick/issues/500