Spry

Open panels programmatically

You can programmatically open different panels by using JavaScript functions. For example, you might have a button on your page that opens a particular accordion panel when the user clicks the button.

 Use the following JavaScript functions to open accordion panels:
<input type="button" onclick="acc10.openFirstPanel()" >open first panel</input>
<input type="button" onclick="acc10.openNextPanel()" >open next panel</input>
<input type="button" onclick="acc10.openPreviousPanel()" >open previous panel</input>
<input type="button" onclick="acc10.openLastPanel()" >open last panel</input>
<script type="text/javascript">
	var acc1 = new Spry.Widget.Accordion("Accordion1");
</script>
You can also use acc10.openPanel(panelNumber) to open any panel. The accordian panels use a zero-based counting system, so setting the value to 2 opens the third panel.