JSFiddle - React, Tailwind, and code Playground
HTML
<button id="left">«</button>
<button id="right">»</button>
<div class="block"></div>
CSS
div {
position: absolute;
background-color: #abc;
left: 50px;
width: 90px;
height: 90px;
margin: 5px;
}
JavaScript
$( "#right" ).click(function() {
$( ".block" ).animate({ "left": "+=50px" }, "slow" );
});
$( "#left" ).click(function(){
$( ".block" ).animate({ "left": "-=50px" }, "slow" );
});