Is it possible to catch mouse position outside the document?
I found that is possible to retrieve the mouse position in IE outside the document or even the browser window, by us开发者_运维知识库ing "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?
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.
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.
精彩评论