Let’s say I want something only to be executed when one thing has been fully executed I do the following:
$('#content-1').fadeIn(function() {
$("menue").slideUp();
});
But what if something should be only be executed if multiple things that have different actions have been fully executed? Like this:
$('#content-1').fadeIn();
$('#content-2').fadeOut();
function() {
$("menue").slideUp();
}
How do I do this without separate and repeat?
Update:
You can use
promise()anddone()methods:DEMO