JSFiddle - React, Tailwind, and code Playground
by alexchetv
HTML
<div id="d1" style="width:100px;height:100px;background:red;">1</div>
<div id="d2" style="width:100px;height:100px;background:green;">2</div>
JavaScript
var a1 = $.Deferred(),
a2 = $.Deferred();
$('#d1').slideUp(2000, a1.resolve);
$('#d2').fadeOut(10000, a2.resolve);
a1.done(function() { alert('a1'); });
a2.done(function() { alert('a2'); });
$.when(a1, a2).done(function() { alert('both'); });