I need some help solving a problem I've encountered.
I need to get the mouse coordinates (X,Y),
(I do it by calling a function with "onMouseMove" that takes an event parameter.
it looks like this:
<html>
<head>
<script language="JavaScript">
function show(event){
X = e.clientX;
Y = e.clientY;
alert("x="+x+" y="+y);
}
</script>
</head>
<body onMouseMove="show(e);">
</body>
</html>
(This is a symplified code).
The problem is, that all of those event handlers dealing with the mouse coordinates (event.x, event.clientX, event.offsetX) deal with the location of the mouse relativitly to the SCREEN and not the HTML PAGE.
I need a code or a new methos that will allow me to get the X,Y coordnates according to the Page.
(If you didn't understand something -And you know how to program in JavaScript-, please tell me so I could clearify).
Does anybody have any idea on how to solve this important issue? Thank You.
I need to get the mouse coordinates (X,Y),
(I do it by calling a function with "onMouseMove" that takes an event parameter.
it looks like this:
<html>
<head>
<script language="JavaScript">
function show(event){
X = e.clientX;
Y = e.clientY;
alert("x="+x+" y="+y);
}
</script>
</head>
<body onMouseMove="show(e);">
</body>
</html>
(This is a symplified code).
The problem is, that all of those event handlers dealing with the mouse coordinates (event.x, event.clientX, event.offsetX) deal with the location of the mouse relativitly to the SCREEN and not the HTML PAGE.
I need a code or a new methos that will allow me to get the X,Y coordnates according to the Page.
(If you didn't understand something -And you know how to program in JavaScript-, please tell me so I could clearify).
Does anybody have any idea on how to solve this important issue? Thank You.