[Javascript] Getting the X,Y coordinates of an image

Peter-Paul Koch gassinaumasis at hotmail.com
Thu Apr 10 01:47:08 CDT 2003



>I have the following code. And I tried the .Top , I get an undefined.  
>.What is the problem ? timing ? .Is it too fast to  query the top ?
>
>document.write ("<img id=XYlocator name=XYlocator src='trans.gif'>")
>document.write (document.all.XYlocator.Top)

This won't work at all. First document.all is IE only, secondly 'Top' should 
be 'top', thirdly the image doesn't (yet) have a top style.

To find the element's position, use the script on the page I sent earlier.

--------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.xs4all.nl/~ppk/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
--------------------------------------------------


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail



More information about the Javascript mailing list