JSFiddle - React, Tailwind, and code Playground

HTML

<html>
<head>
</head>
<body>
    <div id="box">
    </div>
</body>
</html>

CSS

#box {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100px;
    height: 100px;
    background: #F00;
}

JavaScript

$(document).ready(function() {
    var x = $('#box').offset().left;
    var y = $('#box').offset().top;
    galleryScroll();

    function galleryScroll() {
        x = x + 1;
        y = y + 1;
        $('#box').offset({
            left: x,
            top: y
        });
        setTimeout('galleryScroll()', 100);
    }
});