SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2007
    1 Post(s)
    0 Thread(s)

    Cursor Position Problem

    Hi! I have found this cursor position observer script that works great as long as you don't scroll down. But when you scroll down the cursor position becomes relative to the page, not the screen. Have a look and see for yourself:

    What I want is the cursor position to be relative to the screen. So that when I scroll down while my cursor stays in the same position the cursor coordinates don't change.

    My JS knowledge is very basic so I hope someone can help me with this.

    It's a small script so it should be easy for anyone who knows what he or she is doing.

    Here's the code:

    HTML Code:
    <!--        Script by          -->
    <!--        copyright of HIOX INDIA         -->
    <!-- more scripts @ [url][/url] -->
    <script language=javascript>
    window.onload = init;
    function init() {
      if (window.Event) {
      document.onmousemove = getXY;
    function getXY(e) {
      x = (window.Event) ? e.pageX : event.clientX;
      y = (window.Event) ? e.pageY : event.clientY;
      // Use x and y to do what ever you want
    <!-- Script by -->

  2. #2
    Join Date
    Aug 2007
    0 Post(s)
    0 Thread(s)
    you should get the height of browser and add/sub 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