jQuery Mobile: Basic Collapsible Header

This entry is part 25 of 73 in the series jQuery Mobile

To create a collapsible header, simply use data-role=’collapsible’ as the attribute.

<!DOCTYPE html>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
<div data-role='page'>
    <div data-role='header'><h1>Collapsible</h1></div>
    <p>You can click on me</p>
    <div data-role='collapsible'>
    <p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
    <div data-role='footer' data-position='fixed'>
Try The Code
Series Navigation<< jQuery Mobile: Vertically Grouped Radio Buttons
jQuery Mobile: Collapsible with 2 themes >>