Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make a expandable collapsible menu stay open on a new page

Status
Not open for further replies.

devondago

Programmer
Jan 22, 2003
38
US
please help me with an expadable/collapsible menu. This menu was generated in Dreamweaver and I cant seem to make it work. Its an expadable/collapsible menu(9 buttons)that does the following. when you mouseover one of the menu items a submenu opens vertically. The issue is that once you click on one of those sublinks and you are taken to that page the menu closes. I want the menu to remain open
when you are taken to a new page of a submenu.
exmaple oif what my menu looks like this.
In my home page I added the code for the drop down menu.
I know that for all the child pages I need to add logic tying page ids to divs to call the function generated by the editor used to create the dropdown menu.
on the home page where this menu resides I have the code that triggers the motion of the drop down menu on all the
child pages i have the same code as well but i added a line that seems to make it work. (Test_trigMenu1('Aboutmenu',1) this is the name of the main menu and the first submenu. But how can I make the others ones work? Can someone help me with a function so the menu remain open when you are
in set of submenu pages? here are my other sub menu names.
Test_trigMenu1('Bhmenu',1);
Test_trigMenu1('Cancermenu',1);
Test_trigMenu1('Commmenu',1);
Test_trigMenu1('Cvimenu',1);
Test_trigMenu1('Fbmenu',1);
Test_trigMenu1('Hafmenu',1);
Test_trigMenu1('Nsmenu',1);
Test_trigMenu1('Wsmenu',1);
Any help on this would be really appreciated.
 
The example link doesn't work.

I think you might be misunderstanding how javascript and HTML works. The menu can't "remain open" when you go to another page because everything from the previous page is cleared from memory.

There are a few ways to make a menu open to the correct sub in specific pages.

1/ In the onload event of each page (and provided it's the only onload call in the page) you can use this

<body onload=&quot;Test_trigMenu1('Cvimenu',1)&quot;>

2/cookies

3/ Read the URL of the page and use it to decide which menu item to open

4/ Put flags in the page.

I posted examples of 3 and 4 here:


Here is a cookie example:

 
Thank you so much for replying i am going to look in to your suggestion and hopefully come up with a solution to my problem. I get javascript part and the logic. I dont get the Dreamweaver code...I think with the links you suggested to look at I can start working on the solution.
Thank you again.!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top