2.0_beta sync to rsa
[framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / lists / lists-themes.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 - Theming Lists</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>Theming lists</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" class="ui-body">
26                 <div class="content-primary">   
27
28                 <p>All the standard button swatches can be applied to lists. The framework assigns a default list theme swatch of &quot;c&quot; (silver in the default theme) and swatch &quot;b&quot; (blue in default theme) for dividers. Below is a default themed list.</p>
29                 
30 <code>
31 &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot;&gt;
32 </code>
33                 <ul data-role="listview" data-inset="true" data-icon="star">
34                         <li data-role="list-divider">Divider</li>
35                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
36                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
37                         <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
38                 </ul>
39                 
40                 <h2>Theming list items</h2>
41                 <p>The list item color scheme can be changed to any button color theme swatch by adding the <code> data-theme</code> attribute to the list, and setting the letter theme swatch. Here is the same list above with the &quot;a&quot; swatch applied. </p>
42                 
43 <code>
44 &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-theme=&quot;d&quot;&gt;
45 </code>
46                 
47                 <ul data-role="listview" data-inset="true" data-theme="d">
48                         <li data-role="list-divider">Divider</li>
49                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
50                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
51                         <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
52                 </ul>
53                 
54                 <p> data-theme attributes also work at the LI-level, for styling a single item.</p>
55                 
56                 <ul data-role="listview" data-inset="true" data-theme="d">
57                         <li data-role="list-divider">Divider</li>
58                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
59                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
60                         <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
61                         <li data-theme="a"><a href="index.html">Trash <span class="ui-li-count">34</span></a></li>
62                 </ul>
63                 
64                 <h2>Theming dividers</h2>
65                 
66                 <p>The theme for <strong>list dividers</strong> can be set by adding the <code>data-divider-theme</code> to the list and specifying a swatch letter. Here is an example of the same list above with swatch &quot;d&quot; set on the dividers.</p>
67                 
68 <code>
69 &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-theme=&quot;d&quot; data-divider-theme=&quot;e&quot;&gt;
70 </code>
71                 
72                 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e">
73                         <li data-role="list-divider">Divider</li>
74                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
75                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
76                         <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
77                 </ul>
78                 
79                 <h2>Theming count bubbles</h2>
80                 
81                 <p>The theme for <strong>count bubbles</strong> can be set by adding the <code>data-count-theme</code> to the list and specifying a swatch letter. Here is an example with swatch &quot;e&quot; set on the dividers.</p>
82                 
83 <code>
84 &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-theme=&quot;d&quot; data-divider-theme=&quot;e&quot; data-count-theme=&quot;b&quot;&gt;
85 </code>
86                 
87                 <ul data-role="listview" data-inset="true" data-theme="d" data-divider-theme="e" data-count-theme="b">
88                         <li data-role="list-divider">Divider</li>
89                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
90                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
91                         <li><a href="index.html">Sent <span class="ui-li-count">328</span></a></li>
92                 </ul>
93                 
94                 <h2>Theming icons</h2>
95                 
96                 <p>The default icon for each list item is <code>arrow-r</code>. To override this, set the <code> data-icon</code> attribute on the desired list item to the <a href="../buttons/buttons-icons.html">name of a standard icon</a>.  To prevent icons from appearing altogether, set the <code> data-icon</code> attribute to &quot;false&quot;.</p>
97 <pre>
98 <code>
99 &lt;li data-icon=&quot;info&quot;&gt;&lt;a href="#"&gt;Notices&lt;/a&gt;&lt;/li&gt;
100 &lt;li data-icon=&quot;alert&quot;&gt;&lt;a href="#"&gt;Alerts&lt;/a&gt;&lt;/li&gt;
101 &lt;li data-icon=&quot;false&quot;&gt;&lt;a href="#"&gt;No icon&lt;/a&gt;&lt;/li&gt;
102 </code>
103 </pre>
104                 <ul data-role="listview" data-inset="true">
105                         <li data-role="list-divider">Divider</li>
106                         <li data-icon="info"><a href="#">Notices</a></li>
107                         <li data-icon="alert"><a href="#">Alerts</a></li>
108                         <li data-icon="false"><a href="#">No icon</a></li>
109                 </ul>
110         
111                 
112                 <h2>Theming split buttons</h2>
113                 
114                 <p>For split lists which a second button, the framework default to &quot;b&quot; for the theme swatch (blue in the default theme)  Here is a default split list:</p>
115                 
116                 <ul data-role="listview" data-inset="true">
117                         <li><a href="index.html">
118                                 <img src="images/album-bb.jpg" />
119                                 <h3>Broken Bells</h3>
120                                 <p>Broken Bells</p></a>
121                                 <a href="index.html">Purchase album</a>
122                         </li>
123                         <li><a href="index.html">
124                                 <img src="images/album-hc.jpg" />
125                                 <h3>Warning</h3>
126                                 <p>Hot Chip</p></a>
127                                 <a href="index.html">Purchase album</a>
128                         </li>
129                 </ul>
130                 
131 <code>
132 &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-split-theme=&quot;a&quot;&gt;
133 </code>
134                 <p>To specify the color swatch for the icon button on the right, add the <code>data-split-theme</code> to the list and specify a swatch letter. This attribute can also be added to individual split inside list items by adding a <code> data-theme</code> attribute to specific links  (see second list item).</p>
135                 <ul data-role="listview" data-inset="true" data-split-theme="a">
136                         <li><a href="index.html">
137                                 <img src="images/album-bb.jpg" />
138                                 <h3>Broken Bells</h3>
139                                 <p>Broken Bells</p>
140                                 </a>
141                                 <a href="index.html">Purchase album</a>
142                         </li>
143                         <li><a href="index.html">
144                                 <img src="images/album-hc.jpg" />
145                                 <h3>Warning</h3>
146                                 <p>Hot Chip</p>
147                                 </a>
148                                 <a href="index.html" data-theme="e">Purchase album</a>
149                         </li>
150                 </ul>
151
152                 <p>The icon for the split theme can set at the list level by adding the <code>data-split-icon</code> to the list and specifying a <a href="../buttons/buttons-icons.html">standard icon</a>. This attribute can also be added to individual split inside list items by adding a <code> data-icon</code> attribute to specific links (see second list item).</p>
153                 
154 <code>
155 &lt;ul data-role=&quot;listview&quot; data-inset=&quot;true&quot; data-split-theme=&quot;d&quot; data-split-icon=&quot;delete&quot;&gt;
156 </code>
157
158         <ul data-role="listview" data-inset="true" data-split-theme="d" data-split-icon="delete" >
159                 <li><a href="index.html">
160                         <img src="images/album-bb.jpg" />
161                         <h3>Broken Bells</h3>
162                         <p>Broken Bells</p>
163                         </a>
164                         <a href="index.html">Purchase album</a>
165                 </li>
166                 <li><a href="index.html">
167                         <img src="images/album-hc.jpg" />
168                         <h3>Warning</h3>
169                         <p>Hot Chip</p>
170                         </a>
171                         <a href="index.html">Purchase album</a>
172                 </li>
173         </ul>
174
175
176                 
177                 <h2>Examples of all basic list swatches</h2>
178                 
179                 <p><strong>A</strong> swatch</p>
180                 <ul data-role="listview" data-inset="true" data-theme="a">
181                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
182                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
183                         <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
184                 </ul>
185                 
186                 <p><strong>B</strong> swatch</p>
187                 <ul data-role="listview" data-inset="true" data-theme="b">
188                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
189                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
190                         <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
191                 </ul>
192                 
193                 <p><strong>C</strong> swatch</p>
194                 <ul data-role="listview" data-inset="true" data-theme="c">
195                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
196                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
197                         <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
198                 </ul>
199                 
200                 <p><strong>D</strong> swatch</p>
201                 <ul data-role="listview" data-inset="true" data-theme="d">
202                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
203                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
204                         <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
205                 </ul>
206                 
207                 <p><strong>E</strong> swatch</p>
208                 <ul data-role="listview" data-inset="true" data-theme="e">
209                         <li><a href="index.html">Inbox <span class="ui-li-count">12</span></a></li>
210                         <li><a href="index.html">Outbox <span class="ui-li-count">0</span></a></li>
211                         <li><a href="index.html">Trash <span class="ui-li-count">62</span></a></li>
212                 </ul>
213                 
214                 
215                 </div><!--/content-primary -->          
216
217                 <div class="content-secondary">
218
219                         <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
220
221                                         <h3>More in this section</h3>
222
223                                         <ul data-role="listview" data-theme="c" data-dividertheme="d">
224
225                                                 <li data-role="list-divider">List views</li>
226                                                 <li><a href="docs-lists.html">List basics &amp; API</a></li>
227                                                 <li><a href="lists-ul.html">Basic linked list</a></li>
228                                                 <li><a href="lists-nested.html">Nested list</a></li>
229                                                 <li><a href="lists-ol.html">Numbered list</a></li>
230
231                                                 <li><a href="lists-split.html">Split button list</a></li>       
232                                                 <li><a href="lists-divider.html">List dividers</a></li>
233                                                 <li><a href="lists-count.html">Count bubble</a></li>
234                                                 <li><a href="lists-thumbnails.html">Thumbnails</a></li>
235                                                 <li><a href="lists-icons.html">Icons</a></li>
236                                                 <li><a href="lists-formatting.html">Content formatting</a></li>
237                                                 <li><a href="lists-search.html">Search filter bar</a></li>
238                                                 <li><a href="lists-search-inset.html">Inset search filter bar</a></li>
239                                                 <li><a href="lists-search-with-dividers.html">Search filter bar with dividers</a></li>
240                                                 <li><a href="lists-search-filtertext.html">Search filter hidden data</a></li>
241
242                                                 <li><a href="lists-readonly.html">Read-only lists</a></li>
243                                                 <li><a href="lists-readonly-inset.html">Read-only inset lists</a></li>
244                                                 <li><a href="lists-forms.html">Lists with forms</a></li>
245                                                 <li><a href="lists-forms-inset.html">Inset lists with forms</a></li>
246
247                                                 <li><a href="lists-inset.html">Inset styled lists</a></li>
248                                                 <li><a href="lists-performance.html">List performance test</a></li>
249                                                 <li data-theme="a"><a href="lists-themes.html">Theming lists</a></li>
250
251                                         </ul>
252                         </div>
253                 </div>          
254
255         </div><!-- /content -->
256
257         <div data-role="footer" class="footer-docs" data-theme="c">
258                         <p>&copy; 2011-12 The jQuery Foundation</p>
259         </div>
260
261         </div><!-- /page -->
262
263         </body>
264         </html>