Is there are more readable way to queue a number of asynchronous effects that they are executed synchronously?
var element1 = $('#div1');
var element2 = $('#div2');
$(element2).hide();
$(element1).on('click',function(){
$(element1).fadeOut(1000,function(){
$(element2).fadeIn(1000, function(){
$(element2).hide();
alert('hello');
});
});
});