Here is a simple test case for my problem :
http://jsfiddle.net/JZmvf/20/
How to make the parent div normally scroll with mouse wheel, even when the mouse is over the position: fixed element ?
Thanks.
The most typical causes of a mouse that will not scroll are two difficulties. The first is that dust and grime clog the mouse wheel, causing mechanical problems. The second issue is that wireless mice have poor battery life.
The onwheel event occurs when the mouse wheel is rolled up or down over an element. The onwheel event also occurs when the user scrolls or zooms in or out of an element by using a touchpad (like the "mouse" of a laptop).
Its very late for an answer but I was able to overcome this problem by adding pointer-events: none
style to the "fixed" div.
Like this: http://jsfiddle.net/JZmvf/55/
Elements with position: fixed;
are positioned relative to the viewport, so the scrollable
div is not the parent of the fixed
div in this case, even though it may appear that way if you're just looking at the output.
If you position your cursor over the fixed
div and scroll down, your browser is being told to scroll down the fixed
div. Fixed elements, by nature, are not scrollable, so nothing happens.
You may want to add a few more details about exactly what you're trying to accomplish. Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With