문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top