...

View Full Version : How to find the mouse-position without events?



DH2006
02-19-2007, 05:15 PM
How to find the mouse-position without events?

Hi!
I have set an Interval with setInterval that calls a function every second.
How could this function find out the mouse position?

Addidtional question, that I will put in a new thread too:
How to create an event, like described on the W3C-site about the events?

Greetings
Dieter

---
Good to be back on this good forum!

angst
02-19-2007, 06:09 PM
have a look here:
"Capturing Mouse Position"
http://www.breakingpar.com/bkp/home.nsf/0/87256B14007C5C6A87256B4B0005BFA6

DH2006
02-19-2007, 06:15 PM
That uses the onmousemove-event too.
The problem with this event is that it uses much of the CPU, the CPU-load goes high from 0 to 100 percent if moving fast with the mouse.
That's not good.

I bet there is a way to find the mouse-position, at least in Firefox I hope.

(The Javascript is intended to run mainly from one's own computer anyway, so not online, but just save the html as file and display it.)

By the way: I'm using Firefox (1.6 in the moment, maybe 2.0 soon) on Windows XP. I only need a solution for Firefox in the moment.

Greetings
Dieter

angst
02-19-2007, 06:24 PM
runs fine on my system and doesn't use any cpu at all.

however, on your script "setInterval that calls a function every second"
this will cause the cpu usage to go very high and will eventually crash the browser.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum