On Sep 24, 12:47 pm, cerberos <pe...@whywouldwe.com> wrote: > The contents of a fadeOut callback are supposed to be executed after > the fadeOut has completed but there are problems when fading out > multiple selectors (the alert is used to demonstrate). > > $("#foo, #bar").fadeOut( function(){ alert('test'); $("#baz").fadeIn > (); }) > > >>> #baz is faded in before the fadeOut has completed > > $("#foo, #bar").fadeOut( function(){ if( this.id == 'foo' ){ alert > ('test'); $("#baz").fadeIn(); }}) > > >>> for some reason this works > > $("#foo, #bar").fadeOut( function(){ if( this.id == 'bar' ){ alert > ('test'); $("#baz").fadeIn(); }}) > > >>> but this doesn't - it does the same as the first example > > Anyone know why? Is this a bug?
Found a blog post that covers the problem http://www.gmarwaha.com/blog/2009/06/09/jquery-waiting-for-multiple-animations-to-complete/