<<    >>
JQuery: Accordion
This sample inspired by webdesignerwall.com.

Could this be the first question?

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.

And could this be another one?

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.

How many questions are there?

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi malesuada, ante at feugiat tincidunt, enim massa gravida metus, commodo lacinia massa diam vel eros. Proin eget urna. Nunc fringilla neque vitae odio. Vivamus vitae ligula.

Could you tell me a little about how this works?

The code adds a CSS class "active" to the first H3 element within the (div class="accordion") (the "active" class shifts the background position of the arrow icon). Additional code hides all the p elements except the first.

OK. How about a little more?

When the h3 element is clicked, it will slideToggle the next (p) and slideUp all its siblings, then toggle the class="active"