x and y based coordination on mouse move using javascript?

aswinialuri-19361
Posted by aswinialuri-19361 under JavaScript category on | Points: 40 | Views : 1759
Example image:
if your mouse is moving on a image the image coordination will be changed
 <head>
<script type="text/javascript">
function my_fun() {
points.innerText = "(" + event.offsetX + "," + event.offsetY + ")";
}

</script>
</head>


in body section :
<body onmousemove="my_fun()">

<div>

<center><span id="points" >(0,0) </span><img src="picture008.jpg" style="position:absolute;top:auto;left:auto" /> </center>


</div>

Comments or Responses

Login to post response