Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Getting co-ordinates of a box after display.


Message #1 by "Crispin Horsfield" <crispin@c...> on Fri, 30 Aug 2002 22:31:09
I've simplified a problem I'm having to the following:

Take two DIV boxes styles defined as:

	#box1
		{
		width:200px;
		border:1px solid red;
		padding:5px;
		}
	#box2
		{
		margin-top:10px;
		width:200px;
		border:1px solid blue;
		padding:5px;
		}


Put the boxes within the body of a page:

<div id=box1><p>Lorem ipsum dolor esit amet, cons incidunt ut labore et 
dolore magna trud exercitation ullamcorpor susc vel eum irure dolor in 
reprehende dlore eu fugiat nulla pariatur.</p></div>
<div id=box2><p>At lupatum delenit aigue duos dolor tempor sunt in culpa 
qui officia de dereud fails est er expedit distinc peccand quaerer en 
imigent cupidat.</p></div>

What I'm after is the pixel position of the top of the lower box so that I 
can place an object relative to it (actually within it).  I won't know 
where the second box is because I don't know if the user has selected 
large, medium or small text size on their browser.

Thanks in advance.

Crispin Horsfield
Caz Limited, Bristol, UK.

  Return to Index