I have 3 Twitter Bootstrap accordions on my page, each one set up like this:
-
The accepted answer is good, but doesn't exactly answer what they did in order to make that work.
In this fiddle you can see the bare-minimum code that's needed, which is:
First header
Content.
Second header
Other content.
Notice that each panel
has a data-parent
which targets the parent div
with the ID #panels
.
That is the magic sauce you need.