Animating jquery knob to a value
for the awesome plugin from Anthony Terrien
http://anthonyterrien.com/knob/
here is a little snippet to change the knob value to another with animation.
$(document).ready(function(){
$({value: 0}).animate({value: 75}, {
duration: 1000,
easing:'swing',
step: function()
{
$('.animated').val(Math.ceil(this.value)).trigger('change');
}
})
});
You can see it in action: http://okami.hu/titis.html
scroll to te bottom..:)
Written by Bálint Gáspár
Related protips
8 Responses
Working an something similar: http://eskimoblood.github.com/jim-knopf/
really great :)
Thanks. Still working on it as the API isn't that nice yet.
on which line number should i add this Code?
@myandroidrocks: Jquery Knob uses input fields to getting the current value for knob with the code above you can animate the input field value, so you can place this code to your application.js or site.js or something else you use in your website or application:)
Knob also listening to input field change event, and at the end of the code snippet we call trigger change event.
Exactly what I was looking for. Thanks !
The big credits goes to Anthony Terrien for the plugin, I' just extending the usage:)
Thank you very much! It's very helpful to me.The UI is so beautiful.