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

Mess of autoplay with mousedrag | BUG

Open rozaljkeee opened this issue 3 years ago • 4 comments

Issue description:
Autoplay become mess after drag actions, start to scroll any way and any time period https://user-images.githubusercontent.com/89798830/156582970-6109cedd-a85e-481d-816f-e90a25df47de.mp4

Demo link/slider setting:
https://codepen.io/rozaljkeee/pen/qBVLvwd

Tiny-slider version: 2.9.4 Browser name && version: Any

rozaljkeee avatar Mar 03 '22 14:03 rozaljkeee

It can also start to scroll in one side, but scroll several slides at once with different speed :/

rozaljkeee avatar Mar 03 '22 14:03 rozaljkeee

Having similar issues (might be related): if autoplay starts and manual drag happens, it seems that the autoplay timing function is doubled, because suddenly the slide shifts happens more often (looks like 2 functions controlling/sliding the same objects)

Moongazer avatar May 17 '22 20:05 Moongazer

This seems to only happen for us if autoplay: true, mouseDrag: true, and autoplayHoverPause:true. Disabling autoplayHoverPause seems to prevent it from repeating drag events.

djkunkel avatar Jan 31 '23 16:01 djkunkel

This seems to only happen for us if autoplay: true, mouseDrag: true, and autoplayHoverPause:true. Disabling autoplayHoverPause seems to prevent it from repeating drag events.

v2.9.2 I confirm If you remove the property autoplayHoverPause, then there is no problem. If you try to change the slides very quickly with the mouse, then they seem to change randomly (several times per second)

play bug on jsfiddle https://jsfiddle.net/Personality_fox/6wjd873g/

If you want to stop auto play onhover event use this trick https://jsfiddle.net/Personality_fox/6wjd873g/5/

const sliderTns = tns({
  container: "#slider",
  items: 1,
  slideBy: 1,
  autoplay: true,
  autoplayTimeout: 1000,
  mouseDrag: true,
  lazyload: true,
});

const slider = document.getElementById('slider');

slider.addEventListener('mouseover', () => {sliderTns.pause()})
slider.addEventListener('mouseout', () => {sliderTns.play()})

PersonalityFox avatar Aug 09 '23 09:08 PersonalityFox