One more jQuery Collapse plugin variation. Persists open/closed states beetween requests.
JavaScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
demo
src
test
README.md

README.md

jQuery Collapse plugin

It's one more of jQuery Collapse plugin variations. Inspired by Daniel Stock's jQuery-Collapse

It acts as collapse (default) or accordion ({accordion: true} option).

Usage

You have container with following structure (h3s for collapse headers, block elements immediatedly following them for collapsible content):

<div id="some_container">
  <h3>Header #1</h3>
  <div>I am collapsible section #1</div>
  <h3>Header #2</h3>
  <div>I am collapsible section #2</div>
  ... and so on
</div>

And then:

$('#some_container').collapse();

Options

  • accordion: true (default: false) - enables accordion mode - only one section can be open at a time;
  • cookies: true (default: false) - enables cookies support - if you reload page, plugin will remember opened sections and they will stay opened.