Setting absolutely positioned element top/left in Mozilla

Discussion in 'Javascript' started by Hoss, Sep 4, 2006.

  1. Hoss

    Hoss Guest

    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?
    Hoss, Sep 4, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John A Grandy
    Replies:
    3
    Views:
    324
    darrel
    Jun 15, 2004
  2. Guybrush Threepwood
    Replies:
    1
    Views:
    459
    Mitja Trampus
    Dec 14, 2005
  3. Replies:
    13
    Views:
    953
    =?ISO-8859-1?Q?G=E9rard_Talbot?=
    May 5, 2006
  4. Pieter Van Waeyenberge
    Replies:
    1
    Views:
    160
    Pieter Van Waeyenberge
    Feb 9, 2004
  5. Replies:
    5
    Views:
    130
Loading...

Share This Page