Results 1 to 2 of 2

Thread: Getting the mouse position

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2002
    Posts
    61

    Getting the mouse position

    Is there a way I can get the values for the mouse-cursor's screen poistion?

    Thanks.

  2. #2
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602

    Re: Getting the mouse position

    This will work in IE, I am not sure about the other browsers since I can't test them at work.

    HTML Code:
    <html>
    <head>
    <title>Mouse Positions</title>
    <script type = "text/javascript">
    function Show_Coords(){
    frmMain.txtX.value = event.clientX;
    frmMain.txtY.value = event.clientY;
    }
    document.onmousemove = Show_Coords;
    </script>
    </head>
    <body>
    <form ID = "frmMain">
    <label>x:</label><input type = "text" value = "0" ID = "txtX" />
    <label>y:</label><input type = "text" value = "0" ID = "txtY" />
    </form>
    </body>
    </html>
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

Posting Permissions

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



Click Here to Expand Forum to Full Width