Interface elements for jQuery - Documentation - Accordion

Accordion

Create an accordion from a HTML structure.

example

Options:

panelHeight Integer mandatory the pannels' height
headerSelector String mandatory selector for header elements
panelSelector String mandatory selector for panel elements
activeClass String optional CSS Class for active header
hoverClass String optional CSS Class for hovered header
onShow Function optional callback called whenever an pannel gets active
onHide Function optional callback called whenever an pannel gets incative
onClick Function optional callback called just before an panel gets active
speed Mixed optional animation speed, integer for miliseconds, string ['slow' | 'normal' | 'fast']
currentPanel Integer optional the active panel on initialisation

Code sample:

$(document).ready(
	function()
	{
		$('#myAccordion').Accordion(
			{
				headerSelector: 'dt',
				panelSelector: 'dd',
				activeClass: 'myAccordionActive',
				hoverClass: 'myAccordionHover',
				panelHeight: 200,
				speed: 300
			}
		);
	}
);

Download now

Interface 1.2 146kb (source files, compressed files)
jQuery 1.1.2 19 kb

MediaSecure