JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <div class="wrapper">
    </div>
</body>

CSS

body {
    background: #deffff;
}
.wrapper {
    background: url('https://upload.wikimedia.org/wikipedia/commons/b/bc/Gluecksklee_(transparent_background).png') top center no-repeat;
    width:600px;
    height:600px;
}

JavaScript

$(function loop() {

$(".wrapper").animate({temporary_x: 0, temporary_y: 800}, {
    duration: 1000,
    step: function() {
        var position = Math.round(this.temporary_x) + "px " + Math.round(this.temporary_y) + "px";
        $(".wrapper").css("background-position",  position);
    },
    complete: function(){
this.temporary_y=-600;
        console.log($(".wrapper").css("background-position"));
$(".wrapper").animate({temporary_x: 0, temporary_y: 0}, {
    duration: 1000,
    step: function() {
        console.log(this.temporary_y)
        var position = Math.round(this.temporary_x) + "px " + Math.round(this.temporary_y) + "px";
        $(".wrapper").css("background-position",  position);
    },
    complete: function(){

   loop();
    
    
    
    
    }
    
});    
    
    
    
    }
    
});
    
    
});