jQuery Accordion Demo

Standard, container is a div, header is h3 and content p

Code

jQuery('#list1').Accordion();

There is one obvious advantage:

You've seen it coming!
Buy now and get nothing for free!
Well, at least no free beer. Perhaps a bear, if you can afford it.

Now that you've got...

your bear, you have to admit it!
No, we aren't selling bears.

We could talk about renting one.

Rent one bear, ...

get two for three beer.

And now, for something completely different.

Navigation - Unordered List with anchors and nested lists.

Location-based state-saving: The active element is choosen based on location.hash: Click one of the links, then reload the page to see it in action.

Code

jQuery('#navigation').Accordion({
	active: false,
	header: '.head',
	navigation: true,
	event: 'mouseover',
	autoheight: true,
	animated: 'easeslide'
});
With options, container is a definition list, header dt, content dd

Code

// highly customized Accordion
jQuery('#list2').Accordion({
	event: 'mouseover',
	active: '.selected',
	selectedClass: 'active',
	animated: "bounceslide"
}).change(function(event, newHeader, oldHeader, newContent, oldContent) {
	jQuery('<div>' + oldHeader.text() + ' hidden, ' + newHeader.text() + ' shown</div>').appendTo('#log');
});
Red
Fancy stuff about red thingies.
Green
Green! Green! Green!
Blue
Cool kids are blue.
Divitus structure, div container, div header (class title), div content, no active on startup and can be completely closed

Code

jQuery('#list3').Accordion({
		header: 'div.title',
		active: false,
		alwaysOpen: false,
		animated: false
	});
Tennis
One ball, two players. Lots of fun.
Soccer
One ball, 22 players. Lots of fun.
Baseball
Well, one ball, some guys running around, some guys hitting others with a stick.
Sounds like fun, doesn't it?
Well, apart from the running part.
Accordion wizard

Code

var wizard = $("#wizard").Accordion({
	header: '.title',
	event: false
});

$("div.title", wizard).each(function(index) {
	$(this)
	.next()
	.children(":button")
	.filter(".next, .previous")
	.click(function() {
		wizard.activate(index + ($(this).is(".next") ? 1 : -1))
	});
});
Header 1
Content 1
Header 2
Content 2
Header 3
Content 3
Activate via selector, eg. ':first' or ':eq(1)':
Log of the 2nd accordion