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
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Browser mouse X Y coords?

    Hey all,

    I know that event.screenX and event.screenY return the mouse position on the entire screen, but is there a way to return the mouse position relative to just the browser; or a work around? I've tried what seems like everything to no avail.

    Thanks alot!
    Fitz

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    relative to the client is not that big of a deal:

    NS6.0+ IE5.0+:
    event.clientX
    event.clientY

    however if you need the canvas coordinates for absolute positioning..... you are in for a few surprizes....
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    actually I think clientX/Y did the trick, and I am using it for absolute positioning, but the canvas starts at 0,0 so I think thats why it worked.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It does work until you have to scroll the page - then it goes haywire.... let me know what you are trying to do and I may be able to tell you what problems you will face...
    Last edited by Vladdy; 07-09-2002 at 07:43 PM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"


  •  

    Posting Permissions

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