Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top