JSFiddle - React, Tailwind, and code Playground
HTML
<div id="1"></div>
<div id="2"></div>
<div id="3"></div>
<div id="4"></div>
CSS
div {
position: absolute;
background: red;
float: right;
}
div#1 {
top: 0;
left: 70vw;
height: 25vh;
width: 20vw;
}
JavaScript
$(document).ready(function() {
var __THEDIVS = [];
$('#1').each(function() {
__THEDIVS.push($(this));
})
function animate() {
$elem = __THEDIVS.pop();
$elem.animate({
'width': '100px'
}, 200);
if (__THEDIVS.length) {
setTimeout(animate, 500);
}
}
animate();
})