How to disable window scroll with jQuery
In order to disable main windows scrolling with the jQuery I would suggest using onmousewheel event.
window.onmousewheel = document.onmousewheel = function(e) { e = e || window.event; if (e.preventDefault) e.preventDefault(); e.returnValue = false; };
However if you want one of the divs still scroll within the window, you can do the following:
window.onmousewheel = document.onmousewheel = function(e) { if($(e.srcElement).parents("#id_of_the_div_to_allow_scroll").size() == 0) { e = e || window.event; if (e.preventDefault) e.preventDefault(); e.returnValue = false; } };
Dima Svirid
Software architect, JAVA, Spring, Hibernate, AngularJs, Backbone, MongoDB, Oracle. CTO and Co-Founder of Homeadnet.com