PDA

View Full Version : Accordion default to "closed"


dubaco
05-22-2009, 12:09 PM
Is it possible to set the default state of Accordion to be closed so all panels are closed?
Or do I have to accept that this feature appears as open when first loaded?
Many thanks
d

lobwl
05-22-2009, 02:02 PM
It is possible yes, I have just done this with a website I am making.

You need to make sure the following code is at the bottom of body of your page.


<script type="text/javascript">
<!--

var Accordion1 = new Spry.Widget.Accordion("Accordion1", { useFixedPanelHeights: false, defaultPanel: -1 });

//-->
</script>


Assuming your Accordion is called Accordion1, otherwise change this value. Particularly notice that useFixedPanelHeights is set to false and then the defaultPanel is -1 and all should be sorted!

Will

dubaco
05-22-2009, 02:55 PM
Thankyou, you are a star!!

Another example of what a great resource this forum is.

Why can't the adobe website be so clear and concise?

d

Corrosive
05-22-2009, 03:24 PM
Thankyou, you are a star!!

Another example of what a great resource this forum is.

Why can't the adobe website be so clear and concise?

d

Because the Adobe forum isn't run by monkeys with hand grenades like this one...darn it...I've said too much again 8-)

lobwl
05-22-2009, 03:33 PM
Thankyou, you are a star!!

Another example of what a great resource this forum is.

Why can't the adobe website be so clear and concise?

d

Well I came across this forum looking for help myself, but I'm glad I could help you out!

Will

chrissia7890
09-24-2009, 06:03 AM
Hi, this site is good as adobe does not provide much information on things that we normally see in the web.

I am happy to find the above information that i needed for my web.

I do need some advise here since i started with the accordion. i have different height content. i realise that if i were to open one with a lesser content and than follow by another one with a different height. it does not open fully. it actually follows the previous one of a shorter height.

but if i were to close and open again. i manage to see the fully content.

Any suggestion?

chrissia7890
09-24-2009, 02:55 PM
I manage to resolve the problem. so please treat this as closed. Thank you all.

DWcourse
09-24-2009, 07:32 PM
You could share your solution with the rest of the forum.

chrissia7890
09-28-2009, 01:57 PM
Sure,

I mistake the message from lobwl. he mentioned add this

<script type="text/javascript">
<!--

var Accordion1 = new Spry.Widget.Accordion("Accordion1", { useFixedPanelHeights: false, defaultPanel: -1 });

//-->
</script>

So i did but it flicker before opening. what he actually mean was to add { useFixedPanelHeights: false, defaultPanel: -1 } in the end of the body.

veera_ramesh
09-03-2011, 03:11 PM
ya working thanks