Jump to content

[SOLVED] detecting mouse position


Stickybomb

Recommended Posts

Try this :

<html>

<head>

<script language="JavaScript"><!--

if (document.layers) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove=mtrack;

 

function mtrack(e) {

  var Text= 'Coordinates: ';

  if (document.layers) Text += e.pageX+','+e.pageY

  else Text += event.x+','+event.y;

  window.status= Text;

}

//--></script>

</head>

<body>

Move the mouse and see the status change

</body>

</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.