View Full Version : ddaccordion : adding expandone after init

04-24-2008, 11:37 AM

1) Script Title: Accordion Content script

2) Script URL (on DD):

3) Describe problem:

I included the ddaccordion.init in a file (as base.js) with my defaults parameters on all html sheets. It is configured to expand first header at init.

But from time to time, in a few sheets, I want first and second to be expanded.

So I added this line :
<script type="text/javascript">ddaccordion.expandone('collapsehead', 1);</script>
(in <head> or <body>)
But this does not work : only first is expanded.
I do not understand why. How to make it works ?
(I would like not to use extra parameter on URL)

Note that I am new to javascript...


04-24-2008, 09:19 PM
If you want both 1st and 2nd headers to be expanded, make sure in your configuration code, you've set:

collapseprev: true, //Collapse previous content (so only one open at any time)? true/false

to false. Then it's just a matter of choosing one of the two ways explained here (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm) to expand the desired headers.

04-25-2008, 07:22 AM
OK. There is no way to expand one header as I wanted. I will use different init code for these html sheets.

Btw, thanks for your nice works.