I need to \"animate\" a variable with jquery.
Example: The variable value is 1. The value should be 10 after 5 seconds. It should be increase \"smoothl
What you require is the step parameter in the $().animate function.
var a = 1; jQuery('#dummy').animate({ /* animate dummy value */},{ duration: 5000, step: function(now,fx){ a = 1 + ((now/100)*9); } });
demo