JSFiddle - React, Tailwind, and code Playground
by davidmurdoch
HTML
<div class="animate">Hello</div>
CSS
.animate{
height:100px;
width:50px;
background:Red;
border:solid 1px #000;
}
JavaScript
$(function(){
var animate = function(){
$(".animate").not(".goingOut").animate({"width": "100px"}, 2000, function(){
var me = $(this),
ve newMe = me.clone();
newMe.css({"width":"50px"});
newMe.insertBefore(me);
me.addClass("goingOut").animate({"height": "50px"}, 1000, function(){
$(this).remove();
});
animate();
});
};
animate();
});