PDA

View Full Version : Glossy Accordion Menu - Submenus



dk2011
07-29-2011, 04:16 PM
1) Script Title: Glossy Accordion Menu

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

3) Describe problem:
Link to my Testsite: http://www.webstudio-charisma.de/problem/test.html
Here are three sites online.
Punkt 1 - test.html
Punkt 2 Submenu 1 - sub1.html
Punkt 5 Submenu 1 - sub2.html

When I go from the site "test.html" to the plus, the submenu expand. Then I choose "submenu 1" and all works fine. I can go to all sites and the correct submenues are open.

But when I write the link directly in the Browser: http://www.webstudio-charisma.de/problem/sub1.html then the submenu is not open or the last one is open. (But sometimes not the correct one)

I need your help. How can I make, that the submenus in the sites "submenu1", "submenu2" and "submenu3" are open? Even if the user comes by a directly link.

Thanks a lot.

ddadmin
08-01-2011, 04:28 PM
Since you have persistence of the menu states enabled in the initialization code, what's happening is that the sub menu that's getting opened by default when you visit sub1.html becomes dependent on the state of the same menu on the previous page you had visited prior. In order to get a specific header to always be the one expanded on sub1.html, you can one of the following:

1) Use the URL parameter method of telling the script to expand a particular header, by tacking on the parameter ?menuheader=expandindex to the end of your URL. For example: http://www.webstudio-charisma.de/problem/sub1.html?submenuheader=0

See the section "Remote links that expand select headers on the target page" on http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm for more info on this.

OR

2) Disable persistence in the initialization code of the menu on that page, and set the defualtexpanded option to the index of the header you wish to be expanded by default. For example:


ddaccordion.init({
headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
revealtype: "click", //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: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["suffix", "<img src='plus.gif' class='statusicon' />", "<img src='minus.gif' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})