View Full Version : Urban Gray Accordion Menu - no children ruining functionality

07-21-2011, 03:56 PM
1) Script Title: Urban Gray Accordion Menu

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

3) Describe problem:

I'm working off of the Urban Gray Accordion Scrip, some pages have sub pages (about, approach, our work) and some do not. If the user is on a page that there is no sub menu, I don't want another sub menu to show either (This is the current case).

The site: http://thegoodgirlsnyc.com/test/new/index3_7.php

I changed the settings so the:
defaultexpanded value is now 4, so it is placed on a value that does not have any children, and persiststate: false

defaultexpanded: [4], //index of content(s) open by default [index1, index2, etc] [] denotes no content
persiststate: false, //persist state of opened contents within browser session?

Now, my pages do not open the child categories when the user is on the page where the navigation should be expanded. What other perimeters could be changed?

07-21-2011, 06:06 PM
The easiest approach in your case is actually just to manually edit the initialization code of Accordion menu on those pages that you want a sub menu to be expanded by default, by modifying the defaultexpanded option. So on http://thegoodgirlsnyc.com/test/new/approach.php for example, you might modify the initialization code with the change in red:

headerclass: "headerbar", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc] [] denotes no content

1 here would expand the second menu header relative to the other accordion menu headers on the page, which is what you want here.

07-21-2011, 06:17 PM
Thank you for your response, but I am using a php include to have the navigation load on all of the pages, so, one script applies to all of the pages. Is this possible using type of dynamic functionality?