Results 1 to 5 of 5

Thread: Simple Tree Menu Tweak

  1. #1
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Simple Tree Menu Tweak

    Hello All,

    Is it possible to tweek the Simple Tree Menu javascript so that when a user clicks on a folder to open it, all the other folders will automaticly close? Due to space limitations, i can only have one folder open at a time.

    Thank you

  2. #2
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy solution ?

    did you found a solution to this problem yet ?
    i'm having the same issue.

  3. #3
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Warning: Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.

  4. #4
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Simple Tree Menu
    http://www.dynamicdrive.com/dynamicindex1/navigate1.htm


    Same question as the first poster - can someone work some beautiful magic on this so only one folder is open at a time?

    Would be much appreciated. Thanks in advance.

  5. #5
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi all,

    I have maybe solved your problem. But if you use this modification you can just close the root nodes by clicking on another node. If you try to click on the close icon of a root node, nothing happens.

    Open the simplemenutree.js and search for "ulelement.parentNode.onclick=function(e){" then add this code below on top

    Modification:
    PHP Code:
    ulelement.parentNode.onclick=function(e){
    var 
    submenu=this.getElementsByTagName("ul")[0]
    //....................................The modification starts below .....................
    if (this.getElementsByTagName("ul")[0].parentNode.parentNode.parentNode.tagName=="TD") {
    ddtreemenu.flatten("treemenu1""contact")} 
    You must replace "treemenu1" with your treeid.


    P.S: I have also attached the full js file

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
  •