JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent">
<div id="anim_div">:D</div>
</div>
CSS
#parent {
width:400px;
height:150px;
border-right:1px solid red;
-webkit-animation: toggle 2s;
-webkit-animation-timing-function: steps(2, start);
}
#anim_div {
position:absolute;
}
.animation {
-webkit-animation:anim 4s;
}
@-webkit-keyframes anim {
0% {
left:0px;
}
100% {
left:400px;
}
}
@-webkit-keyframes toggle {
0% {
visibility: hidden;
}
100% {
visibility: visible;
}
}
}
JavaScript
$('#parent').addClass('animation');