ganlanyuan / tiny-slider

Vanilla javascript slider for all purposes.
MIT License
5.24k stars 786 forks source link

'gallery' mode + Delay time between slides #826

Open r-interactive opened 1 year ago

r-interactive commented 1 year ago

Hi,

I am using the 'gallery' mode instead of the 'carousel'. I want to add a delay (between slides) for 2 or 3 seconds before going to the next or previous slide. I thought using the option 'animateDelay' will do the trick, but it's not working.

Is there a way to delay the time to go to the next or previous slide when you click on the next/prev buttons?

Code: var slider = tns({ container: '.my-slider', items: 1, mode: "gallery", speed: 300, nav: false, animateDelay: 3000, autoplay: false, controlsPosition: "top", arrowKeys: true, autoplayPosition: "bottom", autoplayButtonOutput: false, mouseDrag: false,

    });  

Tiny-slider version_:
I am using the latest version (v2.9.3) from here: https://github.com/ganlanyuan/tiny-slider

And I am using the min js file (tiny-slider.js) from here: tiny-slider/dist/min/ .

The non-min .js file isn't working for some reason.

Thank you!