JSFiddle - React, Tailwind, and code Playground
HTML
<div id='div1'></div>
<div id='div2'></div>
<button>Click</button>
CSS
div {
display: inline-block;
width: 100px;
height: 100px;
}
#div1 {
background: olive;
}
#div2 {
background: teal;
}
JavaScript
$("button").click( function() {
$("body").queue( function() {
$("#div2").animate({
width: 200
});
});
$("body").queue( function() {
$("#div1").animate({
width: 200
});
});
$("body").dequeue();
});