PDA

View Full Version : find x,y coordinates of images


melCarmasin
05-09-2007, 02:41 AM
Hi, just wondering if its possible to find the x and y coordinates of an image using the dom's onmousemove method. Specifically I need to know if this can be done using onmousemove. If so, how would I put it in my img code for the image.
If this can't be done with onmousemove, what other method would I use?

Here's my image.
<p><img src="assets/header.gif" width="700" height="70" </p>

Mr J
05-09-2007, 01:55 PM
Here's a basic example

<p><img src="assets/header.gif" width="700" height="70" onmouseover="alert('Left = '+this.offsetLeft+'\nTop = '+this.offsetTop)"> </p>