www.webdeveloper.com
Results 1 to 3 of 3

Thread: browsers doesn't react to this code at all!

  1. #1
    Join Date
    Aug 2011
    Posts
    4

    browsers doesn't react to this code at all!

    Hello!
    Could some one help me with this code?

    var mie = (navigator.appName == "Microsoft Internet Explorer")?true:false;

    if (!mie) {
    document.captureEvents(Event.MOUSEMOVE);
    }
    document.mousemove = mousePos; //pie event handler pievieno funkcijas referenci
    var mouseX = 0;
    var mouseY = 0;

    function mousePos(e) {
    if (!mie) {
    mouseX = e.pageX;
    mouseY = e.pageY;
    }
    else { // IE before version 9
    var mouseX = event.clientX + document.body.scrollLeft;
    var mouseY = event.clientY + document.body.scrollTop;
    }

    document.write(mouseX);
    document.write(mouseY);
    return true;
    }

    Just doesn't work anywhere....
    I don't see any error.
    Many thanks about any help!

  2. #2
    Join Date
    Jul 2011
    Posts
    12
    Can you elaborate more on what is not working?

  3. #3
    Join Date
    Aug 2011
    Posts
    4
    document.write(mouseX);
    document.write(mouseY);

    document does not write me any coordinates of pageX or pageY

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles