JSFiddle - React, Tailwind, and code Playground

by Ian Roberts

HTML

<div id="container">
     <div class="element"></div>
</div>

CSS

.element
{
    width:100px;
    height:100px;
    background-color:#000;
    position:relative;
    left:0px;
}

JavaScript

$(document).ready(function(){
    $('.element').animate({'left':($(document).width())+'px'},1000, function(){$('.element').css({'left':'-'+($(document).width())+'px'})});
    $('.element').delay().animate({'left': '0px'},1000, function(){}); 
});

/*
remove delay to bounce out right & come back from right side
*/