I’m using this slider. http://docs.jquery.com/UI/API/1.8/Slider
When I move the slider, I’m getting updated max limit. Now i need to apply this new max value to slider too. Will it be changed if I do something like this:
$("#slider").slider({
change: function () {
.....
.....
var btn = document.getElementById('<%=btnUpdate.ClientID%>');
btn.click();
$("#slider").slider( "option", "max", newValue);
.....
}
Here I’m using async postback on btnUpdate click & in code behind, I’m setting new max limit (which I need to apply to slider) to a hiddenfield.
Will I be able to do this after btn.click(); statement, in change event.
The change method will work, but max is going to be reset after you stop dragging.
If you want to change max value while dragging, you should use “slide” event instead of change. Example here: http://jsfiddle.net/nxtwrld/gvSu6/1/
But I would recommend against that, as the the slider will try to fix handle position according to the new max which will collide with dragging the handle and it will start jumping around – as can be seen in the jsfiddle.