JSFiddle - React, Tailwind, and code Playground
by dougneiner
HTML
<div id="static"></div>
<div id="mover"></div>
CSS
#static { width: 20px; height: 20px; position: relative; top: 200px; background: blue; }
#mover { width: 20px; height: 100px; background: red; position: absolute; top: 0; left: 0;}
body { height: 2000px; }
JavaScript
$("#static").click( function () {
$("#mover").position({
my: "left bottom",
at: "left top",
of: $( "#static" ),
collision: "flip"
});
});