views:

39

answers:

1

I am new to javascript so I might be missing something obvious here, but this is the problem. I am not getting the mouse down / up event if the event happened outside the active area under javascript control, so if the mouse enters the active area (onmouseover event) with the left button down, is there a way to know that the button is down?

Added info : Ideally, I would like to keep track of the mouse even outside the browser window - the way Google maps does - try clicking down the mouse button and move outside the browser - this works in chrome and with some quirks in Firefox. Is it possible to do this while remaining within the bounds of JavaScript or is it some proprietary stuff?

A: 

Yes: ensure that the mouse event handlers to detect a mouse-down event are attached to some element that occupies the entire viewport. For instance the HTML (document) element...

Apologies, I would like to track this even if the mouse is outside the browser... I have added some more information to the question.
Rajan
Not in pure JavaScritpt that I am aware of. However it is possible to use a plugin to accomplish this, for instance a Java applet can be used to track coordinates anywhere on the screen and report that back to the browser javascript.
Thanks for the suggestion.
Rajan