View Full Version : Glossy Accordion Menu Problem

05-09-2011, 05:39 PM
hey iam a newbie to javascripting and thats the reason why i must make a question.
Iam taking your script from http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm

and i think its very nice and working good in my enviroment.

But there is one problem. I made a big menu and sometimes i have a submenu and sometimes i dont have a submenu. All is ok but only thing dont work as i would like. for example, you open the submenu of one thing and click on a side in the submenu, now its open. Now i would like back to the mainpage (there is no submenu at the mainpage), so the browser open the mainpage but the last submenu i had open will not be closed. How can i make it that the menu is closed when iam at a point, where no submenu available.
Hope you understand me ... :)
thx regards

05-09-2011, 11:40 PM
Sounds like you might have persistence of the last opened sub menu turned on. Try turning off inside your initialization code:

<script type="text/javascript">

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: [], //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: true, //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


05-10-2011, 02:34 PM
big thx - it works.
i made the changes in the code on the sides which have no submenu.

But one little thing is there. Hope i can explain it :)

If i click in the menu structure on a side with submenu, the submenu open and i click on the page i want. now the sumbmenu is open at the point where i click and thats what i want ...... now i click back to another page without submenu and the page open and the submenu is closed .... how i it wanted.
But now i click on a submenu, it open and i click a site in the submenu .... the page open BUT he open not the correct submenu where i clicked, he just opened another submenu where i dont click ....... After this and clicking somewhere in menu it all worked good and correct. Except clicking in this way ..... ?????
Sometimes it worked and sometimes there this little problem. i dont understand it, because i dont know the real way to reproduce the error.

thx regards

05-10-2011, 02:43 PM
We need a link to your page - you might have something wrong with your HTML but we dont know that and we can't offer suggestions until we see it.

05-10-2011, 03:15 PM
there is a testversion of the page i make