Spry

Set the default state of the panel

By default the Collapsible Panel widget is open when the web page loads in a browser. You can, however, change the status of the panel if you want the panel to be closed when the page loads.

 Set the contentIsOpen option in the constructor as follows:
<script type="text/javascript">
	var cp1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1", { contentIsOpen: false });
</script>

You can also check the status of the panel with the isOpen function. The following code returns true if the panel is open and false if it is not:

<script type="text/javascript">
function  getStatus(){
var xx = CollapsiblePanel1.isOpen();
document.form1.textfield.value = xx
}
</script>
</head>
<body>
<div id="CollapsiblePanel1" class="CollapsiblePanel">
  <div class="CollapsiblePanelTab" tabIndex="0" onclick="getStatus();">Tab</div>
  <div class="CollapsiblePanelContent">Content</div>
</div>
<form id="form1" name="form1" method="post" action="">
  <input name="textfield" type="text" id="textfield" value="a" size="50" />
</form>
<script type="text/javascript">
<!--
var cp1 = new Spry.Widget.CollapsiblePanel("CollapsiblePanel1");
//-->
</script>