From the course: Learning jQuery UI

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

The Accordion control

The Accordion control - jQuery Tutorial

From the course: Learning jQuery UI

Start my 1-month free trial

The Accordion control

- The last control we'll take a look at in this chapter is the accordion control. So, scroll down to the accordion section in the snippets and open up Accordion_start in your editor. Now, before we make any changes, let's take a look at the content of the page. Here I have a div with an id of accordionCtrl, which we'll use in just a moment. But, you can see that I have some content broken up into various sections. I have a header here, followed by a div which contains some content, and then I have another header with div and content, and so on down the page. I have four sections of content in all. Now, if I just show this in the browser, without doing anything to the page, you can see that this is just plain HTML with some sections and some content. So, I'm going to convert this into an accordion control, which you've probably seen on other websites. Accordion controls are usually used to break up groups of information that the user can read individually. So, let's go back to the code…

Contents