Where is the mouse?!?

C

Csaba2000

I was thinking to use document.elementFromPoint to
determine what element, if any, the mouse is over, but
I need to know the mouse position for that since it
takes (x,y) coordinates.

I'm drawing a real blank on this. How do I get the mouse
position if I'm not in an event handler?

Thanks,
Csaba Gabor from New York
 
L

Lasse Reichstein Nielsen

Csaba2000 said:
I'm drawing a real blank on this. How do I get the mouse
position if I'm not in an event handler?

You can't. You just have to make an event handler (probably for
"mousemove") and store the coordinates somewhere accessible.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top