JSFiddle - React, Tailwind, and code Playground
HTML
<div id="scroller">Some controls</div>
CSS
body {
height: 3000px;
top: 0;
position: relative;
}
#scroller {
position: relative;
top: 100px;
width: 100%;
background: #CCC;
height: 100px;
}
JavaScript
$(window).scroll(function () {
if ($(window).scrollTop() > 100) {
$('#scroller').css('top', $(window).scrollTop());
}
}
);