Perhaps. Though not the "reason" per se, more like why you cannot easily use defaultexpanded. Only the init part of the code, which is instructed to be placed on the page anyway, ex (from the demo page):
Code:
ddaccordion.init({
headerclass: "mypets", //Shared CSS class name of headers group
contentclass: "thepet", //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: [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: ["", "openpet"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none", "", ""], //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(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
}
})
must be unique to each page to allow for a defaultexpanded to be unique to each page.
Perhaps some helper javascript, and/or even server side code (if you have that available) could be setup to select the defaultexpanded on the basis of the address of the page. That way, the init code could probably remain in one file to be used by all pages.
So, do you have a server side language available to you? Also, is there a naming convention for the pages that use this script that could be used to easily determine what the number for defaultexpanded would be based upon each page's name? If not, could one be established?
I could figure most of this stuff (except for what server side language(s), if any are available) out myself if I had a link to the site.
Bookmarks