-
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
-
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
Forum Rules
|
|
Bookmarks