PDA

View Full Version : Simple Tree Menu Tweak



duuuuuuuuuuuuuuude
10-09-2006, 06:00 PM
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

rachid
02-10-2007, 10:50 PM
did you found a solution to this problem yet ?
i'm having the same issue. :confused:

thetestingsite
02-11-2007, 03:28 AM
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

spacefish
05-28-2007, 07:47 AM
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. :)

Dary
12-04-2008, 10:42 AM
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:

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