Documentation

UI/Accordion/activate

From jQuery JavaScript Library

Jump to: navigation, search

« Back to UI/Accordion

activate( index )

Activate a content part of the Accordion programmatically.
The index can be a zero-indexed number to match the position of the header to close or a string expression matching an element. Pass -1 to close all (only possible with alwaysOpen:false).
Arguments:
indexString, Element, jQuery, Boolean, Number
An Integer specifying the zero-based index of the content to be activated or an expression specifying the element, or an element/jQuery object, or a boolean false to close all.


Examples:
Activate the second content of the Accordion contained in <div id="accordion">.

$(".selector").activate(1)

Close all content parts of the accordion.

$(".selector").activate(false)

Activate the first element matching the given expression.

$(".selector").activate("a:first")

NameType