Stop double-scrolling propagation
For http://stackoverflow.com/q/16323770/1454806
HTML
<div class="noscroll">
<ul>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of items to make the div scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
<li>A bunch of text to make the body scroll</li>
</ul>
</div>
JavaScript
$('.noscroll').on('DOMMouseScroll mousewheel', function(ev) {
var prevent = function() {
ev.stopPropagation();
ev.preventDefault();
ev.returnValue = false;
return false;
}
return prevent();
});