Identify a scroll bar: Javascript
I'm writing an extension to Firefox and I'm using JavaScript.
Everytime my mouse uses the scroll bar, my extension goes a little bit crazy.I'd like to know if there's any way to identify t开发者_如何学Gohe mouse is on a scroll bar? Some kind of tag/method/special DOM property - anything!
Thanks.
Can you just check whether the mouse is hovering outside the borders of your page/container? Something like window.screen.width
or similar?
Scroll bars are usually anonymous elements, they are added to HTML elements automatically but they aren't visible in the DOM. However, event.originalTarget
will give you these scrollbar elements if they are the event target (see https://developer.mozilla.org/en/DOM/event.originalTarget).
精彩评论