Question

How to capture scroll event on scrollbar (overflow:scroll div)?

If I do $(selector).on('mousewheel DOMMouseScroll', function (event) {} it captures mouse scroll but how to capture here mouse clicked on scrollbar and moved scroll event?

Putting it diffrently: how to caputre both mouse scroll and mouse click scroll events?

Was it helpful?

Solution

Use the scroll event http://api.jquery.com/scroll/

As stated in the docs

A scroll event is sent whenever the element's scroll position changes, regardless of the cause. A mouse click or drag on the scroll bar, dragging inside the element, pressing the arrow keys, or using the mouse's scroll wheel could cause this event.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top