JSFiddle - React, Tailwind, and code Playground
HTML
<div id="block"></div>
CSS
body {
height: 2000px;
}
#block {
width: 240px;
height: 240px;
background-color: orange;
margin-top: 1000px;
border: 2px solid;
}
JavaScript
var b = $('#block');
$("html").click(function() {
$(this).animate({
top: b.offset().top - $(window).height() + b.outerHeight()
});
});