autopen to certain level

Explorer like navigation tree for websites
Navigationsbaum für Internet Auftritte.
Post Reply
woid
Posts: 2
Joined: 13 Mar 2006, 10:24

autopen to certain level

Post by woid »

Hello

How do I make the treemenu autoopen to a certain level without having to use the configuration panel?
User avatar
Hans
Site Admin
Posts: 77
Joined: 16 Dec 2005, 16:52
Location: Germany
Contact:

Auto-Open a Level

Post by Hans »

Hi 'Woid',

there are two possibilites to open a tree up to a specified level:

1. You can set the variable 'open' in the commands 'add' or 'put' according to the explanations in the help (TreeMenu -> First steps -> Menu items). By this you can set the open/close state of each tree/subtree according to your wisches. E.g. you can open the first subtree up to level four and the second subtree up to level 2,...

2. To open the tree up to a specified level for all subtrees you may call the routine 'level' and manually set the desired level-number. E.g. to open your instance 'yourTree' of the TreeMenu up to level 2 you may code:

Code: Select all

yourTree.add(...);
...
yourTree.level(2);
document.write(yourTree);
in your menu-file.

But remind: If the visitor requested cookies, the tree will be opened with the settings (open/close state for each item) according his last visit. To reset to the defaults, the visitor must clear his cookies.

I hope the above explanations are useful for you. Could you please reply and tell me if it's working as desired?

Thanks
Hans Bauer
Your forum admin
woid
Posts: 2
Joined: 13 Mar 2006, 10:24

Post by woid »

Thanks for the help. It worked perfectly. Option nr 2 was just the thing I was looking for.
Post Reply