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

No members online now.

Forum statistics

Threads
473,800
Messages
2,569,657
Members
45,414
Latest member
GlycoCareGlycogenControl
Top