Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Setting absolutely positioned element top/left in Mozilla

Reply
Thread Tools

Setting absolutely positioned element top/left in Mozilla

 
 
Hoss
Guest
Posts: n/a
 
      09-03-2006
Hello. I have the following markup and code:

<table cellspacing="0" cellpadding="0" id="area1">
// innards
</table>
<table cellspacing="0" cellpadding="0" id="overlay">
// innards
</table>

-- CSS styling these tables
table#area1
{
width:500px;
height:500px;
}
table#overlay
{
width:500px;
height:500px;
}

--javascript that executes onload
// Determine the top and left of area1
document.getElementById("overlay").style.top = top
document.getElementById("overlay").style.left = left

No DOCTYPE

Now- the foregoing works wonderfully in Internet Explorer. However in
Firefox the element that I am positioning - overlay - is ending up
about 9 pixels to the left of where it should be - directly on top of
area1. The code that is determining where it should go is working fine
- top and left are being calculated correctly. However- after I set the
style.left property of the overlay, if I then use javascript to read
that value, it is about 9 pixels off.

Any ideas?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I put an element below another element, that's not absolutely positioned? felipevaldez@gmail.com Javascript 5 09-10-2006 01:56 AM
Broken: absolutely positioned divs within a td in FF subp@wachtel.us HTML 13 05-05-2006 06:44 AM
vertically align absolutely positioned div elements Guybrush Threepwood HTML 1 12-14-2005 09:29 PM
flow content following absolutely-positioned panel John A Grandy ASP .Net 3 06-15-2004 12:04 PM



Advertisments