I have a script that is disabling the scrolling of the body element when I have a popup box showing, however I do not want to disable scrolling for the popup box, (or any other scrollbars other than the main body one), I have established what I want by selecting the element inside the popup box, however I want it to work for everything, not just that one element.
$('html').on('mousewheel DOMMouseScroll', "body", function(e) {
var scrollTo = null;
if (e.type == 'mousewheel') {
scrollTo = (e.originalEvent.wheelDelta * -1);
}
else if (e.type == 'DOMMouseScroll') {
scrollTo = 40 * e.originalEvent.detail;
}
if (scrollTo) {
e.preventDefault();
$(this).scrollTop(scrollTo + $(this).scrollTop());
}
});
$('div').on('mousewheel DOMMouseScroll', ".photos", function(e) {
e.stopPropagation();
});
So what I want to do is for this second script, instead of selecting .photos directly, just selecting any child of < body>