Allow slider to animate if slider value is set programatically
I'm creating a custom jQuery script that relies heavily on ui.slider, and that frequently sets the slider value programatically. Whenever I call $(el).slider('value', x)
, the slider handle simply jumps to its new position, and this doesn't look very nice. I'd much prefer if when I set a new slider value, the handle were to slide elegantly.
Attached patch adds a new 'animate_if_programmed' option to ui.slider. This achieves my purpose nicely. Doesn't change the default behaviour in any way, just allows animation on value change if you configure it to be so.
This is my first patch submitted to jQuery (coming from Drupal land), so please let me know if I haven't properly followed procedures. :P
Fixed in r3361