JSFiddle - React, Tailwind, and code Playground
by GaryC123
HTML
<div class="container">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div> </div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
</div>
CSS
body {
overflow:hidden
}
.container {
width:170px;
}
div div{
width:50px;
height:50px;
display:inline-block;
border:1px solid gray;
background:#fff
}
div div:nth-child(5){
position:absolute;
left:100%;
background:red;
top:0
}
JavaScript
$(function(){
vleft=$("div div:nth-child(6)").offset().left+"px";
vtop=$("div div:nth-child(6)").offset().top+"px";
$("div div:nth-child(5)").animate({"left":vleft,"top":vtop},2000)
})