It’s simple to observe the documents scroll event but I can’t seem to find anything relating to the scroll of any other element with css property overflow being set?
To get around this myself i’ve been observing mousemove which only fires while you hold down on the scrollbar but this would need to be teamed with a mouse wheel observe also to get the full effect.
Could anyone point me in the right direction for a better way of implementing this?
You can use the
onscrollevent, which will fire whenever the element is scrolled, with the mouse wheel, page up/down keys or by dragging the scrollbar:AFAIK, it is supported by IE5.5+, Firefox, Chrome, Safari and Opera but you can test any of them properly at quirksmode.org’s test page.