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

Most upvoted comments

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