JSFiddle - React, Tailwind, and code Playground
by Puddster
HTML
<div class="contentDiv"> </div>
<div class="bigDiv" style="background-color: red">One</div>
<div class="bigDiv" style="background-color: blue">Two</div>
<div class="bigDiv" style="background-color: green">Three</div>
CSS
.bigDiv {
height: 100%;
width: 100%;
position: fixed;
top: 100%;
left: 0px;
font-size: 10em;
font-weight: 900;
text-align: center;
}
JavaScript
var curScroll = $("html").scrollTop();
$(document).ready(function() {
$(".contentDiv").css("min-height", $(window).height() * 2 );
$("html").scrollTop(function() {
if ($(this).scrollTop > curScroll) {
alert("Scrolled Down");
} else {
alert("Scrolled Up");
}
curScroll = $(this).scrollTop();
});
});