[Javascript] Img posiition?

Jeff Walters jeff at cybermill.com
Tue Jul 17 11:04:04 CDT 2001


> 
> Sorry folks 
> anybody knows how I can get the position (top and left) of a img?
> 
> this dont work---
> 
> <script>
>  alert (document.all['my_img'],style.pixelTop);  // this alert return 0
>  alert (document.all['my_img'],style.pixelLeft); // this alert return 0
> </script>
> 
> <img id="my_img" src="my_img.gif">
> 

You have a comma where there should be a period.
  alert (document.all['my_img'].style.pixelTop);  // this alert return 0
  alert (document.all['my_img'].style.pixelLeft); // this alert return 0



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeff Walters   (314) 962-4024

Cybermill Communications
8616 Joseph Ave
St. Louis, MO 63144
Jeff at cybermill.com
http://www.cybermill.com/




More information about the Javascript mailing list