Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reset NoUiSlider?

How can i reset all sliders in particular form using javascript? (jquery also acceptable) http://refreshless.com/nouislider/

like image 336
stkvtflw Avatar asked Oct 25 '25 11:10

stkvtflw


2 Answers

Read the Setting slider values section:

// Set one .noUiSlider.setue
slider.noUiSlider.set(10);
slider.noUiSlider.set([150]);

// Set the upper handle,
// don't change the lower one.
slider.noUiSlider.set([null, 14]);

// Set both slider handles
slider.noUiSlider.set([13.2, 15.7]);
like image 51
Praveen Kumar Purushothaman Avatar answered Oct 26 '25 23:10

Praveen Kumar Purushothaman


A little late, but the link of Praveen's comment pointed me to the right direction.

Inside the noUiSlider-Reference it mentions the reset-method, which reset the slider to its start-value(s), which was exactly what I was looking for:

    // Return to the 'start' values
    // Does NOT reset any other slider properties
    slider.noUiSlider.reset()
like image 23
Sebastian G. Marinescu Avatar answered Oct 26 '25 23:10

Sebastian G. Marinescu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!