I'm using jQuery 1.5.1 This is my code:
$('.cellcontent').animate({ left: '-=190'}, { easing: alert('start ani'), duration: 5000, complete: alert('end ani')});
I get both alerts before the animation starts!? I want the complete function to start after the animation has ended. Any thoughts?
A function to be executed after the animation completes. To learn more about callback, please read our jQuery Callback chapter Required. Specifies one or more CSS properties/values to animate (See possible values above) Optional. Specifies additional options for the animation. Possible values:
Since complete expects a function, it executes the code you pass to it to get a function object that it can call back to when finished. Show activity on this post. Best solution is this.
The animate() method performs a custom animation of a set of CSS properties. This method changes an element from one state to another with CSS styles. The CSS property value is changed gradually, to create an animated effect. Only numeric values can be animated (like "margin:30px").
And complete should be a function. Show activity on this post. You need to pass a function to complete. Since complete expects a function, it executes the code you pass to it to get a function object that it can call back to when finished. Show activity on this post. Best solution is this.
You need to pass a function to call. Instead you are calling the function.
complete: function() { alert('end ani'); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With