Rico Accordion with Memory

Base Library:

Overview

This example remembers the panel you had open the last time you visited. Simply provide a value for options.cookieName. This option also applies to tabbed panels. By default, the cookie value is only remembered for the current session. To have it persist longer, also set options.cookieDays.
HTML Code

The example HTML structure is an outer div that holds all of the panels. Then, each panel is just a couple of DIVs (one for the header and one for the content) wrapped in an outer DIV. The id attribute is only required on the outer div.
 <div id="accordionID">
     <div id="Panel1">
       <div id="Header1">
         Overview
        </div>
        <div id="Content1">
         ... content text ...
        </div>
     </div>
  </div>
  
Rico Code

To attach the accordion behavior to the accordion container div, construct a Rico.Accordion object and pass the id of the outer accordion div to it. This is a bit different than the previous versions.
    new Rico.Accordion( 'accordionID', 
                        {panelHeight:200, cookieName: 'Rico.AccCookie'} );
    
The cookieName parameter causes the accordion to remember its current state in a cookie.
Important Note

The accordion is very flexible. However, you do have to make sure the header and content elements are structured properly.