JSFiddle - React, Tailwind, and code Playground
HTML
Move the mouse over the box and roll :
<div id=b></div>
<span id=s></span>
CSS
#b {
width:200px; height:200px;
background: red;
}
JavaScript
var n = 0;
function mousewheel(e){
$('#s').html('roll number ' + ++n);
console.log(e);
}
$('#b').mouseenter(function() {
window.addEventListener("mousewheel", mousewheel, false); // chrome
window.addEventListener("DOMMouseScroll", mousewheel, false); // firefox
}).mouseleave(function() {
window.removeEventListener("mousewheel", mousewheel, false);// chrome
window.removeEventListener("DOMMouseScroll", mousewheel, false);// firefox
});