Slider issue with dynamically loaded content
Hello,
I have a strange issue with slider when I load the content dynamically. The html content having the slider is injected into the DOM via the html() call.
Versions used :
<b>JQuery - 1.2.1
ui.slider.js - 1.5B2
</b>
Issues are :
<ol><li>change event is fired and ui.value is NaN. Change should not be fired in the first place. And I dont understand how the ui.value can be NaN.</li><li>the handle doesnt move to the startValue. Even with an explicit call
</li></ol><i>$(function){
$("#tnrSlider").slider(
{
startValue : getMon("curTnr"), //50
min : getMon("minTnr"), //0
max : getMon("maxTnr"), //100
steps : nSteps_tnr, //100
slide : function(e,ui){
if(isNaN(ui.value)) return;
//do something
},
change : function(e,ui){
if(isNaN(ui.value)) return;
</i><i> var target = !isNaN(ui.value) ? ui.value : getMon("curTnr");
</i><i> //do something
}
}
);
$("#tnrSlider").slider("<b>moveTo</b>", getMon("curTnr"),0,true);
</i>}
I use the history plugin to push the previous hashed url into browser history. Very interestingly, when I go back and come forward, the slider is set appropriately.
Also, if I debug step by step, it is set fine. Is there any problem with the timing of the events.
Also, if execute the <b>moveTo </b>call using firebug, it sets appropriately.
Is there something that I am missing?
--
Thanks
Ram