I have a problem with my webpage. I have 4 div\'s which should all fade in after the one before fades out. The code I use is:
$(\'.btn\').click(function(){ $
Here's a simple helper function to help you do this.
function fade(thisIn, callback){ boxes.not(thisIn).filter(':visible').delay(5000).fadeOut('slow', function(){ thisIn.fadeIn('slow', callback); }); }
jsFiddle