Appendix N
Accordion
Method | Description | Return Value |
Showing and Hiding Methods | ||
accordion( options) |
Makes the selected elements into accordions (see “Accordion Options”). | jQuery |
accordion('destroy') |
Destroys the selected accordion. | jQuery |
accordion('disable') |
Disables the selected accordion. | jQuery |
accordion('enable') |
Enables the selected accordion. | jQuery |
accordion('option') |
Returns an object containing all the options and their values. | Object |
accordion('refresh') |
Recalculates accordion panels, headers, and heights after modifying an accordion. | jQuery |
accordion('widget') |
Returns a jQuery object that contains the accordion. | jQuery |
Accordion Options | ||
Option | Description | Type |
active |
Determines which panel is open, if any. If the value is set to false , all panels are collapsed. (This requires the collapsible option to be set true . If the value is set to an integer, it opens the corresponding panel, offset from zero.)Default value: 0 |
Boolean, Integer |
animate |
Options for animating the panels. Setting the value to false disables animation. Setting the value to a number sets the length of the animation in milliseconds with the easing effect. If the value is a string, the string is the type of easing animation (see Appendix M, “Effects”). An object can also be provided with easing and duration properties.Default value: {} |
Boolean, Number, String, Object |
collapsible |
Whether all the accordion sections can be closed at once.Default value: false |
Boolean |
Get Web Development with jQuery now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.