JSFiddle - React, Tailwind, and code Playground
HTML
<div id="e1" style="width:200px; height:200px; background-color:#abc;position:absolute;top:0;left:0;">
</div>
<div id="e2" style="width:200px; height:200px; background-color:#789;">
</div>
JavaScript
function moveEl() {
var e1 = $('#e1'),
e2 = $('#e2');
e1.animate({
top: '700px'
}, 1000, 'linear', function () {
e1.css({
top: '0px'
});
});
}
$(document).ready(
this.setInterval(function(){
moveEl();
},1500)
);