peculiar dom model for nested UL elements

Discussion in 'Javascript' started by Henrik Bechmann, Sep 24, 2007.

  1. All,

    I'm trying to spoof Google's vertical tabs in a vertical menu
    structured with nested UL/LI elements.

    To do this, I need to find out where the anchor in the LI is, and then
    create an absolute positioned div to bridge the space between the menu
    and the content page.

    This works with one level of LI's. However, with more than one, the
    nested elements have offsetHeight and clientTop (among others) that
    are set to 0 (zero). (And even more peculiar - using the FF debugger,
    the embedded stacked anchor strings have apparently been converted to
    a single string with embedded line breaks).

    Anyway, I don't get it.

    The question: how do I get positioning information for nested UL/LI
    elements (in both FF and IE6&7).


    - Henrik
    Henrik Bechmann, Sep 24, 2007
    1. Advertisements

  2. Henrik Bechmann

    RobG Guest

    I have no idea what you mean by that. Do you have a link?

    That may make sense if I knew what you were trying to achieve, but I
    don't so it doesn't. :-(

    "stacked anchor strings"? Can you post an example of the HTML that
    you are trying to manipulate? Or a link to a minimal test case?

    Nor do I. ;-)

    Matt Kruse has an object position library, have you tried it?

    <URL: >

    It's not perfect and may not work for your situation, but it's been
    helpful in getting me over a few similar hurdles. Most I'd recommend
    using pure CSS and HTML as much as possible, depending on script for
    position (unless you keep the HTML simple) is generally a bad idea.
    RobG, Sep 24, 2007
    1. Advertisements

  3. This may surprise you, but most (if not all) client-side Google code is
    considered junk and harmful. Try this instead:

    Thomas 'PointedEars' Lahn, Sep 24, 2007
    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.