how to know the position coordinates of an element?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zhaohua_meng
Posted On:   Thursday, July 12, 2001 08:40 AM

Suppose I have the following HTML code:

			




....
.....
.....
This is a test





When it is rendered in a browser, I want to know the coordinates
of the
block, so that I can move an image within the
using JavaScript.

Is there a way to do this? How is the positioning calculated in
JavaScript?
Thanks,

Re: how to know the position coordinates of an element?

Posted By:   Firat_Tiryaki  
Posted On:   Thursday, July 12, 2001 11:45 PM

give table an id to call it as a dynamic element as:


the rest is simple


leftEdge=document.all['t'].style.left;

topEdge=document.all['t'].style.top;