JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container"></div>
CSS
body{
height:800px;
}
#container{
background:red;
height:200px;
width:200px;
}
JavaScript
$('#container').hover(function() {
$(document).bind('mousewheel DOMMouseScroll',function(){
stopWheel();
});
}, function() {
$(document).unbind('mousewheel DOMMouseScroll');
});
function stopWheel(e){
if(!e){ /* IE7, IE8, Chrome, Safari */
e = window.event;
}
if(e.preventDefault) { /* Chrome, Safari, Firefox */
e.preventDefault();
}
e.returnValue = false; /* IE7, IE8 */
}