tiny-slider icon indicating copy to clipboard operation
tiny-slider copied to clipboard

The bug is still showing when **autoplayHoverPause** is set as **true**

Open stavrzt opened this issue 5 years ago • 14 comments

The bug is still showing when autoplayHoverPause is set as true

Wrong behavior when we combine ( "mouseDrag": true and "autoplayHoverPause": true)

Originally posted by @davson584 in https://github.com/ganlanyuan/tiny-slider/issues/298#issuecomment-439031788

stavrzt avatar Mar 26 '19 20:03 stavrzt

I have this exact same issue with version 2.9.2. Following this for hopefully a quick fix.

eriknoorland avatar May 23 '19 10:05 eriknoorland

+1 I'm also seeing this in 2.9.2, when using autoplayHoverPause the timeout isn't reset when manuallly switching slide.

jensjns avatar Jun 27 '19 06:06 jensjns

😢 Same issue with version 2.9.2

notrealdev avatar Sep 04 '19 03:09 notrealdev

I can confirm that this still is quite the issue!

RafaelDeJongh avatar Sep 04 '19 04:09 RafaelDeJongh

Is there a quick fix yet?

ales6164 avatar Oct 11 '19 14:10 ales6164

This additional check should help http://prntscr.com/pr3rj6

slavanau12 avatar Nov 01 '19 12:11 slavanau12

Hi @ganlanyuan , can you check it? The solution of @slavanau12 ?

notrealdev avatar Nov 05 '19 07:11 notrealdev

Same problem here...

alanmunoz avatar Nov 12 '19 17:11 alanmunoz

I have the same problem in 2.9.3. any solution?

bahaedini avatar Nov 09 '21 17:11 bahaedini

Same problem. Package is death?

lunoxx avatar Dec 12 '21 14:12 lunoxx

same issue. 2.9.4

wbh3110 avatar Jun 13 '22 08:06 wbh3110

Have same problem. This error can be fixed by adding "clearInterval(autoplayTimer);" to the "setAutoplayTimer" function

igor150195 avatar Oct 12 '22 05:10 igor150195

Same problem version 2.9.4

coutableN avatar Jan 04 '23 20:01 coutableN

Here is a working solution without any hacks. It was tested on v2.9.3.

var checkRestartAutoplay = function (config, slider) {
    var info = slider.getInfo();

    setInterval(function () {
        if (slider.lastPlayed && Date.now() - slider.lastPlayed > config.autoplayTimeout && !info.container.matches(':hover')) {
            slider.play();
            slider.lastPlayed = Date.now();
        }
    }, 100);
}

var slider = tns({
    container: '#mySlider',
    controls: true,
    autoplay: true,
    rewind: true, // Must be enabled
    items: 4,
    gutter: 20,
    autoplayHoverPause: true,
    arrowKeys: false,
    mouseDrag: true
})

slider.lastPlayed = null;

slider.events.on('indexChanged', function (info) {
    slider.lastPlayed = Date.now();
})

if (config.autoplay) {
    checkRestartAutoplay(config, slider);
}

AbhishekDas avatar Aug 03 '23 15:08 AbhishekDas