JSFiddle - React, Tailwind, and code Playground

HTML

<div class="ele"></div>
<div class="ele"></div>
<div class="ele"></div>
<div class="ele"></div>

CSS

.ele {position: relative; height: 100px; width: 100px; top:0; display: inline-block; background: red;}

JavaScript

$('.ele').on('click', animateEle);

function animateEle(e) {
    $('.ele').stop().animate({'top':'0px'},2000);
    $(e.target).off('click').stop().animate({'top':'100px'},4000, function() {
        $(e.target).on('click', animateEle);
    });
}