TD .offsetTop not working in IE6

Discussion in 'Javascript' started by Gernot Frisch, Apr 22, 2004.

  1. Hi,
    when I have this code in my script:
    pos_y = document.getElementById('holdmenu').offsetTop;

    The menu get's positioned at the very top of the site - really
    annoying. On FireFox it works good. If I put this script part at the
    very end of the body, it works, too.

    Can you help me what's wrong here?



    --
    -Gernot

    Post here, don't email. If you feel you have to mail, revert my
    forename from:

    ________________________________________
    Looking for a good game? Do it yourself!
    GLBasic - you can do
    www.GLBasic.com
     
    Gernot Frisch, Apr 22, 2004
    #1
    1. Advertisements

  2. "offsetTop" is calculated in regards of the offsetParent, a container
    element. Your problem may be related to your setting styles for one of
    this container element after reading the offsetTop value (check any
    absolute-positioned elements). In that case, browsers' implementation
    could take the change into account quite differently.

    Could you post some lines demonstrating the issue?


    Regards,
    Yep.
     
    Yann-Erwan Perio, Apr 22, 2004
    #2
    1. Advertisements

  3. I use a slightly changed version of this:
    http://www.bmchebbi.addr.com/advancedmenunotes.htm

    Can you help? Also, Can you tell me hot to "move" the menu (e.g. after
    a window.onresize)? I think I have to modify the DIVs positions, but I
    don't know how to loop through all of them. That's a bit my problem.
    I'm a C++ coder and JavaScript is so... well... "ambigious". Things
    like:
    var couldbeanyting [];
    anyvar['Somewhere']...

    and then 'Anystring'.SomeOtherFunction and 'this.' is really strange
    to me...

    -Gernot
     
    Gernot Frisch, Apr 23, 2004
    #3
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.