JSFiddle - React, Tailwind, and code Playground

by andrey90vs

HTML

<div id="div1"></div>
<div id="div2"></div>

CSS

#div1{
    background-color:#000000;
    height:50px;
}

#div2{
    background-color:#0F0;
    height:50px;
}

JavaScript

$(function(){
    $("#div1").animate({ width: '200' }, 2000).animate({ width: 'toggle' }, 3000, function(){
    $("#div2").animate({ width: 'toggle' }, 3000).animate({ width: '150' }, 2000);
    });
});