bqworks / slider-pro

A modular, responsive and touch-enabled jQuery slider plugin that enables you to create elegant and professionally looking sliders.
MIT License
876 stars 387 forks source link

How to change autoplayDelay value after some time #318

Closed webprogrammierer closed 3 years ago

webprogrammierer commented 3 years ago

How can I change the autoplayDelay value after the slider is already running, e.g. by clicking on a button?

I want to re-initialize the slider with different values/options after some time.

How to do this?

davidghi commented 3 years ago

You can try this:

var slider = $( ".slider-pro" ).data( "sliderPro" );

slider.settings.autoplayDelay = 3000;

If you want to restart the autoplay, you can stop it first and then start it:

var slider = $( ".slider-pro" ).data( "sliderPro" );

slider.stopAutoplay();
slider.startAutoplay();