slider + fast mouse movements
i was tearing my hair out for a while over this one, and then i realised a certain subtelty that i suppose is known, although if it is it should be better documented:
$('#mySlider1').slider({
slide: function(e,ui){ $('#myAmount1').text(ui.value); }
});
$('#mySlider2').slider({
slide: function(e,ui){ $('#myAmount2').text($('#mySlider2').slider('value')); }
});
produces two sliders that behave similarly, although the latter lags a little. meaning that with a fast mouse movement i can make the slider reach the end of its rail and not be on its maximum value. of course if i duplicate the function and add it as a "stop" event callback as well, that pretty much solves it because the slider has in fact attained the maximum value but my "slide" callback just hasnt executed a quick enough update. alternatively i could do as above and use the ui object passed to the function.
is this because calling $() on an object takes longer? perhaps this was the very reason the ui object is passed into the funciton in the first place, to solve issues like this one?!
any enlightenment would be appreciated :)