Collapsible Inset vs. full width



Description

To create a full width collapsible without styling the corners, add data-inset attribute and set to false. This displays the collapsibes set as an expandable listview.

Example

Following example demonstrates the use of collapsible set without corner styles in jQuery Mobile.

<!DOCTYPE html>
<html>
   <head>
      <title>Collapsible Inset vs. full width</title>
      <meta name = "viewport" content = "width = device-width, initial-scale = 1">
      <link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
      <script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
      <script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
   </head>

   <body>
      <div data-role = "collapsibleset" data-inset = "false">
         <div data-role = "collapsible">
            <h3>Audi</h3>
            <ul data-role = "listview" data-inset = "false">
               <li>Audi A3</li>
               <li>Audi Q3</li>
               <li>Audi A4</li>
               <li>Audi A3 cabriolet</li>
            </ul>
         </div>
         
         <div data-role = "collapsible">
            <h3>Hyundai</h3>
            <ul data-role = "listview" data-inset = "false">
               <li>Verna</li>
               <li>Elantra</li>
               <li>Santa Fe</li>
               <li>Creta</li>
            </ul>
         </div>
         
         <div data-role = "collapsible">
            <h3>Toyota</h3>
            <ul data-role = "listview" data-inset = "false">
               <li>Corolla Altis</li>
               <li>Fortuner</li>
               <li>Land Cruiser Prado</li>
               <li>Land Cruiser 200</li>
            </ul>
         </div>
      </div>
   </body>
</html>

Output

Let's carry out the following steps to see how the above code works −

  • Save the above html code as collapsible_inset_fullwidth.html file in your server root folder.

  • Open this HTML file as http://localhost/collapsible_inset_fullwidth.html and the following output will be displayed.

jquery_mobile_widgets.htm
Advertisements