I am having an issue where setting overflow-x: hidden on the html and body elements is preventing the jquery scroll event from firing.
CSS:
html, body {
overflow-x: hidden;
}
JS:
$(function(){
$(window).on("scroll", function(e){
console.log("scrolling");
});
});
Try it for yourself: Comment out overflow-x: hidden and pop open your console. You should see "scrolling" logged as you scroll up and down the html box. Comment it back in and the scroll event is silent.
Does anyone know why this is happening? I'm aware that when you set overflow to hidden it disables scrolling, but it should only do it for the axis that you are setting (x only in this case). Thanks in advance for any help.