From the course: jQuery Mobile Essential Training

Unlock the full course today

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

Using collapsible content blocks

Using collapsible content blocks - jQuery Mobile Tutorial

From the course: jQuery Mobile Essential Training

Start my 1-month free trial

Using collapsible content blocks

Another really useful content layout tool in jQuery mobile is the collapsible block and we're going to take a look at that now. So here I am in the snippets and I've scrolled down in chapter 6 to the collapsible block section and let's open up collapsible blocks_start. And what we're going to do is exercise the code that builds these collapsible blocks. Collapsible blocks are basically a control that expands and contracts to show and hide content and I'm sure you've seen these in many applications before. So let's just go ahead and copy one over. And I'll copy that, and we'll paste this into the UI content section here. And, what I've got is a layout container and the data role is set to collapsible. And that's all you need to do to make this a collapsible block. So what I'm going to do is save this, and then run it in the browser. And you can see that a collapsible block basically has an icon, right? And the icon changes to be a plus and a minus when it's open and closed and you can…

Contents