When I use the fade/slide/animate functions in jQuery the callback gets called multiple times for each element the effect is applied to. This is by design of course. I jus
That would produce the alert when the fadeOut on the last element was called. That would not necessarily be the last fadeOut.
var numDivs = $('div').length; $('div').fadeOut(1000, function() { if( --numDivs > 0 ) return; alert('this is the final fadeout to complete'); });
Check it out on JSFiddle