JSFiddle - React, Tailwind, and code Playground
HTML
<div id="fixed"></div>
CSS
body {
height:1500px;
}
#fixed {
width:218px;
height:57px;
background:red;
position:fixed;
bottom:0;
margin-left:200px;
}
JavaScript
$(document).ready(function () {
var offset = $("#fixed").offset();
$(window).scroll(function () {
if ($(window).scrollTop() > offset.top) {
$("#fixed").css({
'bottom': '0px',
'position': 'fixed'
});
} else {
$("#fixed").css({
'bottom': '120px',
'position': 'fixed'
});
}
});
});