This is a discussion on "Tree Menu Script Problem" within the JavaScript Forum section. This forum, and the thread "Tree Menu Script Problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Tree Menu Script Problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Tree Menu Script Problem
Here's my script for opening and closing a folder in a tree menu:
If I have 2 folders, folder a & folder b, folder a subfolder a-a subfolder a-b folder b subfolder b-a subfolder b-b and I click on folder a, I want to be able to click on folder b and have folder a close. I want it to do the same for all the submenus. Thanks for any help! |
|
|
|
|||
|
You need to use a variable to track if a folder is open, and which one it is. Then when you go to open another you'd check that and close it if necessary.
|
|
|||
|
Could you give an example maybe?
Here's some sample code of the tree structure if it helps:
Thanks! |
|
|||
|
I didn't test this, but I don't think I made any mistakes:
|
|
|||
|
Thanks, and that works great for the top level only, but I need all the levels, sublevels included to work in the same way, similar to windows explorer so when you click on a folder on each level every other folder closes!
|
![]() |
| Tags |
| tree, menu, script, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with tree menu | mcnika | JavaScript Forum | 1 | May 22nd, 2008 13:13 |
| CSS JS tree menu & IE6 | cheekyGirl | JavaScript Forum | 6 | Feb 26th, 2008 14:30 |
| A tree menu problem | jim28100 | JavaScript Forum | 0 | Dec 12th, 2007 09:45 |
| TREE-view disply problem | sreenivas2k | Classic ASP | 0 | Jul 19th, 2006 09:37 |
| Problems with javascript tree menu. Please help. | Rei03 | JavaScript Forum | 0 | Nov 20th, 2005 01:35 |