Try offsetTop and offsetLeft Bob Filipiak (Contractor) MCP -----Original Message----- From: Jeff Walters [mailto:jeff at cybermill.com] Sent: Tuesday, July 17, 2001 12:04 PM To: javascript at LaTech.edu Subject: Re: [Javascript] Img posiition? > > 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/ _______________________________________________ Javascript mailing list Javascript at LaTech.edu http://www.LaTech.edu/mailman/listinfo/javascript -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010717/f0aa845e/attachment.htm>