Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to find the mouse-position without events?

    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!

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    have a look here:
    "Capturing Mouse Position"
    http://www.breakingpar.com/bkp/home....256B4B0005BFA6

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •