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?


    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
    Gernot Frisch, Apr 22, 2004
    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?

    Yann-Erwan Perio, Apr 22, 2004
    1. Advertisements

  3. I use a slightly changed version of this:

    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
    var couldbeanyting [];

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

    Gernot Frisch, Apr 23, 2004
    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.