capturing click events on web-browser scrollbars

Posted by The Code Pimp on Stack Overflow See other posts from Stack Overflow or by The Code Pimp
Published on 2010-04-25T23:26:20Z Indexed on 2010/04/25 23:33 UTC
Read the original article Hit count: 233

Filed under:
|
|
|

Hi, is it possible to capture a click event on a scrollbar? I have some code where i am observing the click and mousedown events on the document. However, it seems that when I click on the scrollbar, the event is not captured. This leads me to believe that the scrollbars aren't really part of the document. (Assumption :-)) Is this a correct assumption? What is the right way to do this so that the behaviour is consistent across all major browsers?

sample code

document.observe('click', function(evt){
    //do something
    //blah blah blah
});

Thanks

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html