I try $(\'somediv\').fadeOut.remove();
but it only remove it, bang... it dont wait for the nice fadeOut, and THEN remove
why.. how to respect fadeout, and t
Use a callback:
$('somediv').fadeOut( function() { $(this).remove(); });
The code in the callback function you're passing to fadeOut()(docs) will not execute until the animation is complete.
Example: http://jsfiddle.net/p2LWE/
An alternative would be to queue()(docs) the remove()(docs) , but I think the callback is better.
$('somediv').fadeOut()
.queue(function(nxt) {
$(this).remove();
nxt();
});