Suppose I have some div, and I use .animate({opacity:0},400, function(){}); for its children.
Is it ever possible then to get the remaining time for an animation to complete? eg, 200 ms remaining, or 0 if there’s no animation?
Thanks.
Suppose I have some div, and I use .animate({opacity:0},400, function(){}); for its children. Is
Share
To help you better understand how you can use the
stepfunction[as posted by gdoron]
I created an example using the step function to get the remaining time:
(click the
get state!button to stop the animation and retrieve the remaining time!)demo with distance
demo with opacity
Distance example jQuery:
fx.propinside theanimation stepto get the (left) property that is currently animated.(now*time)/distance) and thanks to the returnednowvalue.