Here is a demonstration of what I am trying to accomplish using jsFiddle.
In my design, I have multiple div
elements within the parent window size, preventing the need for scrolling on the body.
The goal is to listen for the scroll event on the window
, and if no other div
is being scrolled (i.e., nothing else is moving), then the .mainContent
should start scrolling.
For instance, if I am scrolling within the .sidebar
, only the sidebar should scroll. However, if I move the mouse wheel at the right edge, indicating no active scrolling, then the .mainContent
div should scroll instead, mimicking an overflow behavior as if the body had more content.
Does this explanation make sense?
My question is how can I detect when no other element is currently being scrolled with the mouse wheel input so that I can trigger the scrolling action on the .mainContent
in such situations?