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>
<html>
<head>
    <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>
    <title>Upwhere</title>
</head>
<body>
<br>
<div data-role='page'>
    <div data-role='header'><h1>Collapsible</h1></div>
    <br>
    <p>You can click on me</p>
    <div data-role='collapsible'>
    <h4>Heading</h4>
    <p>I'm the collapsible content. By default I'm closed, but you can click the header to open me.</p>
</div>
    <div data-role='footer' data-position='fixed'>
        <h1>Footer</h1>
    </div>
</div>
</body>
</html>
Try The Code
Series Navigation<< jQuery Mobile: Vertically Grouped Radio Buttons
jQuery Mobile: Collapsible with 2 themes >>