views:

227

answers:

2

I found that is possible to retrieve the mouse position in IE outside the document or even the browser window, by using "window.onblur" or "window.onfocusout" or something like that.

Even in Firefox it gives you negative mouse coordinates in the onmouseout event handler if you let your mouse pointer go out of the viewport quickly.

Can there be done more in Firefox, something that gets close to the aforementioned IE behaviour?

A: 

No. Unless the user is continuing a drag motion from within the window, you can't get mouse movement events when the mouse is outside the window with Firefox. I don't know of any hacks to get around this limitation.

Jeremy Stein
+1  A: 

One method would be to write a java applet that is actually executed on the user-side. Then using java controls track the mouse position any where on the user screen.

Harley Green
Ah, that's clever.
Jeremy Stein
interesting idea, thanks
Moom