Accordion.js

Contains Accordion

License

MIT-style license.

Summary
Accordion.jsContains Accordion
AccordionThe Accordion class creates a group of elements that are toggled when their handles are clicked.
Properties
addSectionDynamically adds a new section into the accordion at the specified position.
displayShows a specific section and hides all others.

Accordion

The Accordion class creates a group of elements that are toggled when their handles are clicked.  When one elements toggles in, the others toggles back.  Inherits methods, properties, options and events from Fx.Elements.

Note

The Accordion requires an XHTML doctype.

Arguments

togglersrequired, a collection of elements, the elements handlers that will be clickable.
elementsrequired, a collection of elements the transitions will be applied to.
optionsoptional, see options below, and Fx.Base options and events.

Options

showinteger, the Index of the element to show at start.
displayinteger, the Index of the element to show at start (with a transition). defaults to 0.
fixedHeightinteger, if you want the elements to have a fixed height. defaults to false.
fixedWidthinteger, if you want the elements to have a fixed width. defaults to false.
heightboolean, will add a height transition to the accordion if true. defaults to true.
opacityboolean, will add an opacity transition to the accordion if true. defaults to true.
widthboolean, will add a width transition to the accordion if true. defaults to false, css mastery is required to make this work!
alwaysHideboolean, will allow to hide all elements if true, instead of always keeping one element shown. defaults to false.

Events

onActivefunction to execute when an element starts to show
onBackgroundfunction to execute when an element starts to hide
Summary
Properties
addSectionDynamically adds a new section into the accordion at the specified position.
displayShows a specific section and hides all others.

Properties

addSection

Dynamically adds a new section into the accordion at the specified position.

Arguments

toggler(dom element) the element that toggles the accordion section open.
element(dom element) the element that stretches open when the toggler is clicked.
pos(integer) the index where these objects are to be inserted within the accordion.

display

Shows a specific section and hides all others.  Useful when triggering an accordion from outside.

Arguments

indexinteger, the index of the item to show, or the actual element to show.
The Accordion class creates a group of elements that are toggled when their handles are clicked.
Fx.Elements allows you to apply any number of styles transitions to a selection of elements.
Base class for the Effects.

Documentation by Aaron Newton & Mootools Developers, generated by NaturalDocs and GeSHi