Reputation: 48505
i have a jQuery line that execute 2 animations, what i want is to remove the #flasher
DIV after sliding it up by my current code. How to add a callback in this bunch of brackets?
here is my code:
$("#flasher").animate({opacity: 1.0}, 6000).animate({"top": "-=30px"},"slow");
Thanks
Upvotes: 0
Views: 175
Reputation: 1659
this should to it
$("#flasher").animate({opacity: 1.0}, 6000).animate({"top": "-=30px"},"slow", function() {
$("#flasher").remove();
});
Upvotes: 1
Reputation: 30883
You need to add callback function as the next parameter in last call to animate. The animate api page has some examples.
Upvotes: 0
Reputation: 25620
$("#flasher").animate({opacity: 1.0}, 6000)
.animate({"top": "-=30px"},"slow",function(){
$(this).remove();
});
Upvotes: 1