PDA

View Full Version : Switch Menu question



dtblkg35
10-02-2004, 02:41 PM
Script: Switch Menu (http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm)

I have successfully added and slightly modified this scrip for a site I am designing. When I first used the menu on the site I noticed that the tree does not stay expanded once on a sub category page. I would like to keep the sub category expanded while viewing that area. I am new to js and have no idea where to begin to add this function. Any help would be greatly appreciated.
My site (http://www.strappingtoolsandparts.com/index.asp?PageAction=VIEWCATS&Category=6)

cr3ative
10-02-2004, 05:22 PM
So are you looking for the script to behave like this? Click (http://www.treeview.net/treeviewfiles/demoFrameless.html)

cr3ative

dtblkg35
10-02-2004, 05:53 PM
Thank you for your response. That is close but not exactly. Here is an example navigation from another site Example (http://powerlinkcables.com/catalog/index.php?cPath=29). The only problem with the script you have shown me is that once you leave a category it tree does not collapse.

Thank you

dtblkg35
10-03-2004, 02:52 PM
I am getting closer to finding the answer. This might be some help in the future to someone who has individual pages that are not dynamically created that needs this function. The easiest way to have the sub menu stay open would be to use onload event in each of the pages

<body onload="SwitchMenu(\'sub2\')"> .
This will not work for my site because i can not put that code in each of the pages it would need to go. So is there a way to pass the 'onload' event keeping the sub-menu open over the pages? :confused: