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(){
$
You may be better off using the callback version of those methods:
$('.btn').click(function(){
$('#box1').fadeOut('slow', function() {
$('#box2').fadeIn('slow', function() {
$('#box2').fadeOut('slow', function() {
$('#box3').fadeIn('slow', function() {
$('#box3').fadeOut('slow', function() {
$('#box4').fadeIn('slow', function() {
$('#box4').fadeOut('slow');
});
});
});
});
});
});
});
jsFiddle