JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div id="child">
</div>
</div>
CSS
#parent {
background-color: blue;
color: blue;
width: 150px;
height: 150px;
}
#child {
background-color: red;
color: red;
width: 50px;
height: 50px;
top: 50px;
left: 50px;
position: absolute;
}
JavaScript
$('#parent').animate({width:0,height:0},{step: function(now, fx) {console.log("step: ", now);}})