shlagish
10-11-2003, 03:03 AM
Hello,
here is the code I come up with.
<html>
<head>
<script type="text/javascript">
<!--
var posX;
var posY;
function position()
{
posX=event.ClientX;
posY=event.ClientY;
alert(posX);
alert(posY);
}
-->
</script>
</head>
<body onMouseMove="position()">
</body>
</html>
I did try to do this:
<html>
<head>
<script type="text/javascript">
<!--
function position()
{
alert(event.ClientX);
alert(event.ClientY);
}
-->
</script>
</head>
<body onMouseMove="position()">
</body>
</html>
but there was the same result:
The alert boxes say "undifined" instead of revealing the X and Y position of the cursor.
Why is this not working?
Thanks
here is the code I come up with.
<html>
<head>
<script type="text/javascript">
<!--
var posX;
var posY;
function position()
{
posX=event.ClientX;
posY=event.ClientY;
alert(posX);
alert(posY);
}
-->
</script>
</head>
<body onMouseMove="position()">
</body>
</html>
I did try to do this:
<html>
<head>
<script type="text/javascript">
<!--
function position()
{
alert(event.ClientX);
alert(event.ClientY);
}
-->
</script>
</head>
<body onMouseMove="position()">
</body>
</html>
but there was the same result:
The alert boxes say "undifined" instead of revealing the X and Y position of the cursor.
Why is this not working?
Thanks