View Full Version : Accordion Menu doesn't start expanded

04-04-2008, 02:33 AM
1) Script Title: Glossy Accordion Menu

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

3) Describe problem: I've got it installed at http://www.yourstorewizards.com and it's working fine but I want to get the first section on the left nav to automatically start opened. I've got defaultexpanded set to 0 but that doesn't do it (and I've tried all the combinations I can think of). I'm probably missing something minor but any help is appreciated.


04-04-2008, 07:42 AM
Hmm where is your initialization code located? This part that is:

headerclass: "submenuheader", //Shared CSS class name of headers group
contentclass: "submenu", //Shared CSS class name of contents group
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
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: "normal", //speed of animation: "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
onopenclose:function(header, index, state, isclicked){ //custom code to run whenever a header is opened or closed
//do nothing

It's hard to tell, since you have so many .js references on that page.

04-04-2008, 02:55 PM
I realized last night as I was falling asleep that it would be hard to find. The settings are actually loaded in the file at http://lib.store.yahoo.net/lib/rtmltemplates/accordionsettings.js


04-16-2008, 05:02 PM
Okay, I removed most of the page and left pretty much the nav without very little other html and still can't figure out what I'm doing wrong. the new test page is at http://dts.yourstorewizards.com/don/accordion.html

Can anyone take a look and let me know if I'm just not understanding the setting to get the first section to open by default?

04-16-2008, 05:04 PM
Okay, I guess I have to backtrack as now it's working. I'm guessing something when I moved it and cleaned it all out made it work (Wasn't working locally with the same code). So nevermind for now.

04-17-2008, 03:38 AM
Actually this may be my fault. There was a bug (http://www.dynamicdrive.com/forums/showthread.php?t=31310) in ddaccordion.js that prevented the defaultexpanded setting from working. This was fixed on April 9th (only the .js file changed).

04-17-2008, 04:48 AM
Thanks so much. I downloaded the new file and it seems to have fixed it. Glad I'm not going crazy.