View Full Version : Glossy accordian submenus open haphazardly

02-13-2012, 12:12 AM
1) Script Title: Glossy accordion menu

2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm

3) Describe problem:
When I click from the home page to a secondary page, I would like to see the menu/submenu for the secondary page open - and only that menu/submenu. For example, when I click from home to collections, the collections page would appear with only the collections page menu/submenu open. http://www.tmatelson.com/Bettison/index.html

Now, it defaults to whichever menu was open before, which is confusing. Or No menu/submenu is open and then folks don't know to click to see submenu options. So, when i click from the home page to the collections page, I would like for only the collections menu/submenu to be open.

I tried using the defaultexpanded: [] but that makes all the submenus open.
Mouseover features doesn't help the problem.

02-13-2012, 09:27 PM
On each of your pages containing the Accordion Menu, if you set the defaultexpanded[] option to just the page in question, disable persiststate and enable collapseprev, that should accomplish what you're looking to do. Now the issue with this approach is that you have to individually modify the defaultexpanded[] on each of your pages containing the menu to point to that page, which on large sites may not be feasible.

Another approach is to explicitly expand a header on the target page by modifying the URL that points to it on the previous page with a query string in the form of "?headerclass=index_of_header_to_expand". See "Remote links that expand select headers on the target page (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm)" in the docs for more info.

02-14-2012, 01:39 AM
the first solution is what I tried previously and it results in ALL the menus being open, not just the specific one desired.

the second solution is unclear for the code I'm using... I tried replacing the
<a class="menuitem submenuheader" href="C_collections.html"></a> with collections in place of submenuheader, and
<a href="C_collections.html?headerclass=collections">

just didn't work. The examples in the link you sent are mostly for opening a link on the same page....

What am I doing wrong?

02-14-2012, 04:23 AM
With further trial and error, I believe I get it and it is working. I did have another problem with the disable persiststate when i needed to keep a section open while using the subsections - improved performance with some weaknesses! Using this:

<li><a href="C_collections.html?submenuheader=1">Collections &amp; Research</a></li>


thank you!