PDA

View Full Version : DDACCORDION does not do what I want



Harm Millaard
05-17-2012, 03:05 PM
1) Script Title:
DDACCORDION does not do what I want

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

3) Describe problem:
I have this code ddaccordion.init({headerclass:"mypets",contentclass:"thepet",revealtype:"mouseover",mouseoverdelay:500,collapseprev:true,defaultexpanded:[],onemustopen:false,animatedefault:false,persiststate:false,toggleclass:["","openpet"],togglehtml:["none","",""],animatespeed:"slow",oninit:function(expandedindices){},onopenclose:function(header,index,state,isuseractivated){}})</script>
on my page http://ppbm6.com/Planning.html

However switching from panel to panel does not reset to the default state.
What I want is to have the panel switch to the default mode after switching panel, no open accordions anymore. Same as after reloading the page.

See http://www.millcon.nl/Harm/Accordion.png

ddadmin
05-17-2012, 05:44 PM
Looking at your page, the headers are currently set to expand/contract onmouseover, and the previous header (ie: "Filters") *does* contract when the current one is expanded (ie: "positive air pressure). As to your question of how to persist this state even when the page is reloaded, try setting the "persiststate" option inside the initialization code to true:


ddaccordion.init({headerclass:"mypets",contentclass:"thepet",revealtype:"mouseover",mouseoverdelay:500,collapseprev:true,defaultexpanded:[],onemustopen:false,animatedefault:false,persiststate:true,toggleclass:["","openpet"],togglehtml:["none","",""],animatespeed:"slow",oninit:function(expandedindices){},onopenclose:function(header,index,state,isuseractivated){}})

Harm Millaard
05-17-2012, 06:24 PM
To show you what I mean in saying weird behavior, do the following:

Reload the page
Open the Case panel
Open the Cooling panel
Everything is OK
Open the Case panel and expand the Start header
Open the Cooling panel and expand the Filters header
Open the Case panel

Now you see the problem: the Start header is no longer highlighted, but is still expanded and does not collapse when another header is selected.

The persiststate option did not solve it for me.

Thanks for your suggestion however.