You can simply specify the initial value by setting it as a pseudo selector.
Let's consider that you need to animate some value that is not a CSS property from -100 to 100. In this case, your code will be:
$({xyz: -100}).animate({xyz:100}, {duration:5000, complete:function(){ console.log("done"); }, step: function(now) {
You can see a working example in JSFiddle here .
Alex under
source share