Collapsible Sets

Description

Collapsible sections in collapsible sets are visually grouped together.

Only one section may be expanded at a time.

Example


<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Collapsible Set Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet"
  href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head><!--from  ww  w .  j  a va  2  s. com-->
<body>

  <div data-role="page" id="home" data-theme="b">
    <div data-role="header" data-theme="a">
      <h1>Settings</h1>
    </div>

    <div data-role="content">

      <div data-role="collapsible-set" data-theme="a"
        data-content-theme="b">
        <div data-role="collapsible" data-collapsed="true">
          <h3>Wireless</h3>
          <ul data-role="listview" data-inset="true">
            <li><a href="#">&#xe117; A</a></li>
            <li><a href="#">&#xe01d; B</a></li>
          </ul>
        </div>

        <div data-role="collapsible">
          <h3>Applications</h3>
          <ul data-role="listview" data-inset="true">
            <li><a href="#">&#xe001; C</a></li>
            <li><a href="#">&#xe428; D</a></li>
            <li><a href="#">&#xe03d; E</a></li>
          </ul>
        </div>

        <div data-role="collapsible" data-collapsed="true">
          <h3>Display</h3>
          <ul data-role="listview" data-inset="true">
            <li><a href="#">Brightness</a></li>
            <li><a href="#">Auto-rotate screen</a></li>
          </ul>
        </div>

        <div data-role="collapsible" data-collapsed="true">
          <h3>Sound</h3>
          <ul data-role="listview" data-inset="true">
            <li><a href="#">Sound profile</a></li>
            <li><a href="#">Volume</a></li>
          </ul>
        </div>

        <div data-role="collapsible" data-collapsed="true">
          <h3>Security</h3>
          <ul data-role="listview" data-inset="true">
            <li><a href="#">Set up screen lock</a></li>
            <li><a href="#">Visible passwords</a></li>
          </ul>
        </div>
      </div>


    <div data-role="collapsible-set">
      <div data-role="collapsible" data-collapsed="true">
        <h3>Section A</h3>
        <p>This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. </p>
      </div>
      <div data-role="collapsible" data-collapsed="true">
        <h3>Section B</h3>
        <p>This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. </p>

      </div>
      <div data-role="collapsible" data-collapsed="true">
        <h3>Section C</h3>
        <p>This is a test. This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. </p>

      </div>
      <div data-role="collapsible" data-collapsed="true">
        <h3>Section D</h3>
        <p>This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. </p>

      </div>
      <div data-role="collapsible" data-collapsed="true">
        <h3>Section E</h3>
        <p>This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. 
        This is a test. This is a test. This is a test. This is a test. </p>
      </div>
    </div>
    </div>
  </div>
</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Tutorial »




jQuery_Mobile
Form
List
Layout
Theme