I want to reset the <div id="slider">
on clicking certain button.
<div>
contains the slider (not important here).
is there any function like $(#slider).reset()
or $(#slider).clear()
or anything that clears the slider <div>
?
I want to reset the <div id="slider">
on clicking certain button.
<div>
contains the slider (not important here).
is there any function like $(#slider).reset()
or $(#slider).clear()
or anything that clears the slider <div>
?
to reset the slider
$("#value-slider").slider("value", $("#value-slider").slider("option", "min") );
to empty a div
$("#value-slider").empty();
You can set a value, e.g. the minimum for this slider (0
):
$('#slider').slider("value", 0);
Also see this example.
To set to the maximum:
$('#slider').slider('value', $("#slider").slider("option", "max"));
Also see my updated example.
=== UPDATE ===
I've updated my example once more. Now you can alert the current value and set the maximum to 30 too:
$('#slider').slider('option', 'max', 30);
...
alert($('#slider').slider('value'));
It's a bit difficult to judge what exactly you want, but have a look at this :
How to reset a jQuery UI slider?
http://forum.jquery.com/topic/slider-moving-slider-back-to-beginning-slider-reset-method
Example :
$("#slider").slider("value", $("#slider").slider("option", "min") );
There is a function empty()
which can suffice your need.
You can try
$("#slider").empty()
This will clear your <div>
so that you can reset some other slider on it again
Sliderjs:
To reset to first slide, Apply the following line in cancel or close button click event $('.pagination li:first a').click();