SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation How to get treeMenu work inside <table>

    In the "Javascript Anthology" sample code there is the source code and a sample html page for the DHTML treeMenu (Chapter 15).
    This code works fine as long as it's standalone code in the html <body>.
    But as soon as you move the treeMenu inside a table column (what you always do with a navigation menu if it's not in a separate frame),
    • top level menu items do not expand anymore
    • the shown top level items are treated as simple links
    • the folder or "+"/"-" icons (background) is not displayed anymore.

    To me it looks, as if the top level items of the menu are now treated as leaf items of the tree.

    Any help or idea? Thanks
    Mark

  2. #2
    SitePoint Addict jtrelfa's Avatar
    Join Date
    Oct 2004
    Location
    Troy, Mi
    Posts
    231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a suggestion - have you considered using CSS-P for your layout instead of a table?

  3. #3
    SitePoint Guru
    Join Date
    Mar 2004
    Location
    Earth
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well yes, a CSS layout would be better than a table-based layout - what you're doing here is an improper-exception rather than a rule.

    But either way ... there's no specific problem as far as the menu is concerned; it neither knows nor cares about its surrrounding environment.

    So the problem must be something else - have you got a demo online?

  4. #4
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    fooled myself with test settings

    I just noticed that the treeMenu works (after cache-clearing:=(),
    but that the second instance one the same page doesn't.
    (My test page had the menu standalone, then inside table).
    So, whenever you put the menu twice on the same page,
    the first one works. Whether inside table or not. Sorry.

    Two other questions:
    (1) Has anyone tried to REMEMBER the menu items open/closed
    states, e.g. by indexing items and writing their state to a cookie?
    This would be nice when switching pages / following menu links.
    (2) Has anyone tried to write a "open all" and "contract all" function?
    "Open all" would correspond to a site map, "contract all" to a top
    level overview.

    Thanks
    php_markl


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •