JSFiddle - React, Tailwind, and code Playground
HTML
<div id="result"></div>
CSS
body {
height: 500px;
}
JavaScript
$(function () {
var lastS = $(window).scrollTop();
$(window).on("mousewheel", function () {
var currentS = $(window).scrollTop();
if (currentS > lastS) {
lastS = currentS;
$("#result").append("Scroll down<br>");
} else {
lastS = currentS;
$("#result").append("Scroll up<br>");
}
});
});