HTML content only scrolls with scrollbar, not mouse wheel
Asked Answered
P

1

10

I have a <div> on my page with a fixed height, and overflow-y: scroll; set so that the content will scroll when it passes the bottom edge of the <div>. Nothing out of the ordinary.

For some bizarre reason, the mouse wheel will only scroll the content if the cursor is over empty space in the <div> or if it's over the scrollbar itself. If the cursor happens to be over any of the text content in the <div>, the mouse wheel won't do anything.

This happens in both Firefox and Chrome, so it isn't just a quirk of a particular rendering engine or something.

The <div> in question is overlaid on top of another via position: absolute;, so I'm assuming that somehow the <div> behind it is interfering with the mouse wheel event - but then you'd think the problem would be reversed (the <div> would scroll when the cursor was over the text, not over the empty space).

Anyone else ever see anything like this before? I'm stumped!

Polyvinyl answered 4/5, 2012 at 13:27 Comment(2)
Weird, could you post it on jsfiddle?Fcc
I am able to replicate the problem: jsfiddle.net/qNS3S/1Firing
P
7

Got it - it's because I was using the FancyBox mousewheel plugin. This causes FancyBox to capture all mousewheel events (for use with scrolling through galleries). Since I'm not actually using any galleries, I have no need for it, so I took it out and immediately that fixed my problem.

Polyvinyl answered 4/5, 2012 at 14:35 Comment(1)
in my case, two plugins were there - mousewheel plugin and smoothpagescrollPopele

© 2022 - 2024 — McMap. All rights reserved.