By : Lamovo Published On Saturday, October 06, 2012, 20:56 In JavaScript
Looking for an accordion instead? Check out Accordion A or Tabs + Accordion.
Toggle Panel fits right into a responsive or fluid design. Fixed width is possible too.
Specify an expanded text (e.g. “Read more” when collapsed and “Read less” when expanded) either via a data attribute or as a jQuery option.
Once the toggle panel element is focused, you can use the space key to toggle it.
With JavaScript disabled, content remains visible and accessible.
With HTML5 Local Storage the state (expanded or collapsed) is saved and restored upon reentering the page. Or you can choose for Session Storage, which remembers the state during a single browsing session.
Hash link to any toggle panel or its content.
With the Pause Media option, HTML5 audio and video elements inside a toggle panel are automatically paused when it is collapsed.
Though Toggle Panel is made as simple as possible, it has extended documentation to help you out.
Smooth and beautiful CSS3 transitions bring Toggle Panel to life.
Like to hangout with LESS? There you go, the LESS stylesheets are included in the download package.
Two themes are included, Minimal and Boxed.
Additionaly, there is an empty CSS and LESS theme which you can use to kickstart your own.
You can create multiple instances on the same page and you can embed toggle panels multiple levels.
Expanding, collapsing and toggling content can be done through the API.
Go to the API documentation for a complete overview of available methods, options and events.