2.0_beta sync to rsa
[framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / content / content-collapsible-options.html
1 <!DOCTYPE html> 
2 <html>
3         <head>
4         <meta charset="utf-8">
5         <meta name="viewport" content="width=device-width, initial-scale=1"> 
6         <title>jQuery Mobile Docs - Collapsible Content</title> 
7         <link rel="stylesheet"  href="../../css/themes/default/jquery.mobile.css" />  
8         <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9
10         <script src="../../js/jquery.js"></script>
11         <script src="../../docs/_assets/js/jqm-docs.js"></script>
12         <script src="../../js/"></script>
13
14 </head> 
15 <body> 
16
17         <div data-role="page" class="type-interior">
18
19                 <div data-role="header" data-theme="f">
20                         <h1>Collapsible</h1>
21                         <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
22                         <a href="../nav.html" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
23                 </div><!-- /header -->
24
25         <div data-role="content">
26                 <div class="content-primary">
27                 <h2>Collapsible content</h2>
28                 
29                         <ul data-role="controlgroup" data-type="horizontal" class="localnav">
30                                 <li><a href="content-collapsible.html" data-role="button" data-transition="fade">Basics</a></li>
31                                 <li><a href="content-collapsible-options.html" data-role="button" data-transition="fade" class="ui-btn-active">Options</a></li>
32                                 <li><a href="content-collapsible-methods.html" data-role="button" data-transition="fade">Methods</a></li>
33                                 <li><a href="content-collapsible-events.html" data-role="button" data-transition="fade">Events</a></li>
34                         </ul>
35
36                         <p>The collapsible plugin has the following options:</p>
37
38                 <dl>
39                         <dt><code>collapsed</code> <em>boolean</em></dt>
40                         <dd>
41                                 <p class="default">default: true</p>
42                                 <p>When false, the container is initially expanded with a minus icon in the header. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
43 <pre><code>$( document ).bind( "mobileinit", function(){
44     <strong>$.mobile.collapsible.prototype.options.collapsed = false;</strong>
45 });
46 </code></pre>
47                                 <p>This option is also exposed as a data attribute: <code>data-collapsed=&quot;false&quot;</code>.</p>
48                         </dd>
49
50                         <dt><code>collapseCueText</code> <em>string</em></dt>
51                         <dd>
52                                 <p class="default">default: " click to collapse contents"</p>
53                                 <p>This text is used to provide audible feedback for users with screen reader software. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
54 <pre><code>$( document ).bind( "mobileinit", function(){
55     <strong>$.mobile.collapsible.prototype.options.collapseCueText = " collapse with a click";</strong>
56 });
57 </code></pre>
58                         </dd>
59
60                         <dt><code>contentTheme</code> <em>string</em></dt>
61                         <dd>
62                                 <p class="default">default: null, inherited from parent</p>
63                                 <p>Sets the color scheme (swatch) for the collapsible content block. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
64 <pre><code>$( document ).bind( "mobileinit", function(){
65     <strong>$.mobile.collapsible.prototype.options.contentTheme = "a";</strong>
66 });
67 </code></pre>
68                                 <p>This option is also exposed as a data attribute: <code>data-content-theme=&quot;a&quot;</code>.</p>
69                         </dd>
70
71                         <dt><code>expandCueText</code> <em>string</em></dt>
72                         <dd>
73                                 <p class="default">default: " click to expand contents"</p>
74                                 <p>This text is used to provide audible feedback for users with screen reader software. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
75 <pre><code>$( document ).bind( "mobileinit", function(){
76     <strong>$.mobile.collapsible.prototype.options.expandCueText = " expand with a click";</strong>
77 });
78 </code></pre>
79                         </dd>
80
81                         <dt><code>heading</code> <em>string</em></dt>
82                         <dd>
83                                 <p class="default">default: "h1,h2,h3,h4,h5,h6,legend"</p>
84                                 <p>Within the collapsible container, the first immediate child element that matches this selector will be used as the header for the collapsible. To change the selector, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
85 <pre><code>$( document ).bind( "mobileinit", function(){
86     <strong>$.mobile.collapsible.prototype.options.heading = ".mycollapsibleheading";</strong>
87 });
88 </code></pre>
89                         </dd>
90
91                         <dt><code>iconpos</code> <em>string</em></dt>
92                         <dd>
93                                 <p class="default">default: "left"</p>
94                                 <p>Positions the icon in the collapsible header. Possible values: left, right, top, bottom, none, notext.</p>
95 <pre><code>$( document ).bind( "mobileinit", function(){
96     <strong>$.mobile.collapsible.prototype.options.iconpos = "right";</strong>
97 });
98 </code></pre>
99                                 <p>This option is also exposed as a data attribute: <code>data-iconpos=&quot;right&quot;</code>.</p>
100                         </dd>
101
102 <!--
103                         <dt><code>iconTheme</code> <em>string</em></dt>
104                         <dd>
105                                 <p class="default">default: "d"</p>
106                                 <p>Sets the color scheme (swatch) for the collapsible header icon. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
107 <pre><code>$( document ).bind( "mobileinit", function(){
108     <strong>$.mobile.collapsible.prototype.options.iconTheme = "a";</strong>
109 });
110 </code></pre>
111                                 <p>This option is also exposed as a data attribute: <code>data-icon-theme=&quot;a&quot;</code>.</p>
112                         </dd>
113 -->
114
115                         <dt><code>initSelector</code> <em>CSS selector string</em></dt>
116                         <dd>
117                                 <p class="default">default: ":jqmData(role='collapsible')"</p>
118                                 <p>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as collapsibles. To change which elements are initialized, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
119 <pre><code>$( document ).bind( "mobileinit", function(){
120     <strong>$.mobile.collapsible.prototype.options.initSelector = ".mycollapsible";</strong>
121 });
122 </code></pre>
123                         </dd>
124
125                         <dt><code>mini</code> <em>boolean</em></dt>
126                         <dd>
127                                 <p class="default">default: false</p>
128                                 <p>Sets the size of the element to a more compact, <a href="../forms/forms-all-mini.html">mini version</a>. If the value is false for an individual collapsible container, but that container is part of a collapsible set, then the value is inherited from the parent collapsible set. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
129 <pre><code>$( document ).bind( "mobileinit", function(){
130     <strong>$.mobile.collapsible.prototype.options.mini = true;</strong>
131 });
132 </code></pre>
133                                 <p>This option is also exposed as a data attribute: <code>data-mini=&quot;true&quot;</code>.</p>
134                         </dd>
135                         <dt><code>theme</code> <em>string</em></dt>
136                         <dd>
137                                 <p class="default">default: null, inherited from parent</p>
138                                 <p>Sets the color scheme (swatch) for the collapsible. It accepts a single letter from a-z that maps to the swatches included in your theme. To set the value for all instances of this widget, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
139 <pre><code>$( document ).bind( "mobileinit", function(){
140     <strong>$.mobile.collapsible.prototype.options.theme = "a";</strong>
141 });
142 </code></pre>
143                                 <p>This option is also exposed as a data attribute: <code>data-theme=&quot;a&quot;</code>.</p>
144                         </dd>
145
146
147                 </dl>
148         </div><!--/content-primary -->          
149         
150         <div class="content-secondary">
151                 
152                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
153                         
154                                 <h3>More in this section</h3>
155                                 
156                                 <ul data-role="listview" data-theme="c" data-dividertheme="d">
157                                 
158                                         <li data-role="list-divider">Content Formatting</li>
159                                         <li><a href="content-html.html">Basic HTML styles</a></li>
160                                         <li><a href="content-grids.html">Layout grids (columns)</a></li>
161                                         <li data-theme="a"><a href="content-collapsible.html">Collapsible content blocks</a></li>
162                                         <li><a href="content-collapsible-set.html">Collapsible sets (accordions)</a></li>
163                                         <li><a href="content-themes.html">Theming content</a></li>
164         
165                                 </ul>
166                 </div>
167         </div>
168
169 </div><!-- /content -->
170
171 <div data-role="footer" class="footer-docs" data-theme="c">
172                 <p>&copy; 2011-12 The jQuery Foundation</p>
173 </div>
174         
175 </div><!-- /page -->
176
177 </body>
178 </html>