JSFiddle - React, Tailwind, and code Playground
HTML
<div class="container">
<div id="a" style="float:left;width:50px;height:50px"></div>
<div id="b" style="float:left;width:50px;height:50px"></div>
<div id="c" style="float:left;width:50px;height:50px"></div>
<div id="d" style="float:left;width:50px;height:50px"></div>
<div id="e" style="float:left;width:50px;height:50px"></div>
<div id="f" style="float:left;width:50px;height:50px"></div>
</div>
CSS
.container div{
background-color: #f00;
margin-right: 10px;
}
JavaScript
$('.container div').on('click', function(){
$(this).css({
'background-color':'transparent'
}).animate({'width':'0px'}, 400, 'linear', function(){
$(this).fadeOut();
});
});