dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Does not work in IE

Hybrid View

  1. #1
    Join Date
    Dec 2011
    Location
    Bucharest Romania
    Posts
    40

    Does not work in IE

    This code only displays coordinates in FF not in IE.

    function catchit(){
    document.onmousemove = mouseMove;
    document.onmouseup = mouseUp;
    }
    function mouseCoords(ev){
    if(ev.pageX || ev.pageY){
    return {x:ev.pageX, y:ev.pageY};
    }
    return {
    x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
    y:ev.clientY + document.body.scrollTop - document.body.clientTop

    };
    };

    function mouseMove(ev){

    ev = ev || window.event;
    mousePos = mouseCoords(ev);
    }
    function mouseUp(ev){
    alert(ev.pageX+" - "+ev.pageY)
    }

    THANK YOU FOR YOUR HELP

  2. #2
    Join Date
    Dec 2011
    Location
    Bucharest Romania
    Posts
    40
    If you don't know from what function to start, here is the html code:

    <body bgcolor="gray" onload="catchit()">

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