how to call a function when the animation is complete

$s.css({"opacity": 0}, 500).removeClass("active"); 

1 answer 1

I think this will be more correct.

$ ('# selector'). animate ({opacity: 0}, 500, function () {alert ('Animation ended with');});

A more detailed example here is http://jsfiddle.net/Rigiytip/R2hF4/