开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜