JSFiddle - React, Tailwind, and code Playground

HTML

<div id="animate">
<img id="b" src="http://www.web-press.it/folder/servizi_cloud.jpg" id="b" style="position:absolute;"/>
</div>

CSS

#animate{
    position: fixed;
    bottom: 0;
    overflow:hidden;
    left:0;
    right:0;
    height: 100px;
    background: #eee;
}

JavaScript

function moveRight(){
        $("#b").animate({left: "+=300"}, 2000,moveLeft)
    }
    
function moveLeft(){
        $("#b").animate({left: "-=300"}, 2000,moveRight)
    }

$(document).ready(function() {

       moveRight();
    
});