Tizen 2.1 base
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.0.1pre / docs / api / data-attributes.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 - Data Attribute Reference</title> 
7         <link rel="stylesheet"  href="../../css/themes/default/" /> 
8         <link rel="stylesheet" href="../_assets/css/jqm-docs.css"/>
9         <script src="../../js/jquery.js"></script>
10         <script src="../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
11         <script src="../_assets/js/jqm-docs.js"></script>
12         <script src="../../js/"></script>
13 </head> 
14 <body> 
15
16 <div data-role="page" class="type-interior">
17
18         <div data-role="header" data-theme="f">
19                 <h1>Data Attributes</h1>
20                 <a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
21         </div><!-- /header -->
22
23         <div data-role="content" data-theme="c">
24
25                 <div class="content-primary">
26                         <h2>Data- attribute reference</h2>
27                         <p>The jQuery Mobile framework uses HTML5 <code>data-</code> attributes to allow for markup-based initialization and configuration of widgets. These attributes are completely optional; calling plugins manually and passing options directly is also supported. To avoid naming conflicts with other plugins or frameworks that also use <code>data-</code> attributes, set a custom namespace by modifying the <a href="globalconfig.html"><code>ns</code> global option</a>.<p>
28
29                                 <style>
30                                         table { width:100%; border-bottom:1px solid #ccc; }
31                                         th { text-align:left; width: 170px; }
32                                         th, td { vertical-align:top; border-top:1px solid #ccc; padding: 6px 10px 4px 0; }
33                                 </style>
34
35                         <h2><a href="../buttons/buttons-types.html">Button</a></h2>
36                         <p>Links with <code>data-role="button"</code>. Input-based buttons and button elements are auto-enhanced, no <code>data-role</code> required</p>
37                         <table>
38                                 <tr>
39                                         <th>data-corners</th>
40                                         <td><strong>true</strong> | false</td>
41                                 </tr>
42                                 <tr>
43                                         <th>data-icon</th>
44                                         <td>home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search</td>
45                                 </tr>
46                                 <tr>
47                                         <th>data-iconpos</th>
48                                         <td><strong>left</strong> | right | top | bottom |  notext</td>
49                                 </tr>
50                                 <tr>
51                                         <th>data-iconshadow</th>
52                                         <td><strong>true</strong> | false</td>
53                                 </tr>
54                                 <tr>
55                                         <th>data-inline</th>
56                                         <td>true | <strong>false</strong></td>
57                                 </tr>
58                                 <tr>
59                                         <th>data-shadow</th>
60                                         <td><strong>true</strong> | false</td>
61                                 </tr>
62                                 <tr>
63                                         <th>data-theme</th>
64                                         <td>swatch letter (a-z)</td>
65                                 </tr>
66                         </table>
67                         <p>Multiple buttons can be wrapped in a container with a <code>data-role="controlgroup"</code> attribute for a vertically grouped set. Add the <code>data-type="horizontal"</code> attribute for the buttons to sit side-by-side.</p>
68
69
70                         <h2><a href="../forms/checkboxes/">Checkbox</a></h2>
71                         <p>Pairs of labels and inputs with <code>type="checkbox"</code> are auto-enhanced, no <code>data-role</code> required</p>
72                         <table>
73                                 <tr>
74                                         <th>data-role</th>
75                                         <td>none (prevents auto-enhancement to use native control)</td>
76                                 </tr>
77                                 <tr>
78                                         <th>data-theme</th>
79                                         <td>swatch letter (a-z) - Added to the form element</td>
80                                 </tr>
81                         </table>
82
83                         <h2><a href="../content/content-collapsible.html">Collapsible</a></h2>
84                         <p>A heading and content wrapped in a container with the <code>data-role="collapsible"</code></p>
85                         <table>
86                                 <tr>
87                                         <th>data-collapsed</th>
88                                         <td><strong>true</strong> | false</td>
89                                 </tr>
90                                 <tr>
91                                         <th>data-content-theme</th>
92                                         <td>swatch letter (a-z)</td>
93                                 </tr>
94                                 <tr>
95                                         <th>data-theme</th>
96                                         <td>swatch letter (a-z)</td>
97                                 </tr>
98                         </table>
99
100                         <h2><a href="../content/content-collapsible-set.html">Collapsible set</a></h2>
101                         <p>A number of collapsibles wrapped in a container with the <code>data-role="collapsible-set"</code></p>
102                         <table>
103                                 <tr>
104                                         <th>data-content-theme</th>
105                                         <td>swatch letter (a-z) - Sets all collapsibles in set</td>
106                                 </tr>
107                                 <tr>
108                                         <th>data-theme</th>
109                                         <td>swatch letter (a-z) - Sets all collapsibles in set</td>
110                                 </tr>
111                         </table>
112                         
113                         <h2><a href="../pages/page-dialogs.html">Dialog</a></h2>
114                         <p>Container with <code>data-role="page"</code> or <code>"dialog"</code> linked to with <code>data-rel="dialog"</code> on the anchor.</p>
115                         <table>
116                                 <tr>
117                                         <th>data-close-btn-text</th>
118                                         <td>string (text for the close button, dialog only)</td>
119                                 </tr>
120                                 <tr>
121                                         <th>data-dom-cache</th>
122                                         <td>true | <strong>false</strong></td>
123                                 </tr>
124                                 <tr>
125                                         <th>data-id</th>
126                                         <td>string (unique id for the page)</td>
127                                 </tr>
128                                 <tr>
129                                         <th>data-fullscreen</th>
130                                         <td>true | false (used in conjunction with fixed toolbars)</td>
131                                 </tr>
132                                 <tr>
133                                         <th>data-overlay-theme</th>
134                                         <td>swatch letter (a-z) - overlay theme when the page is opened in a dialog</td>
135                                 </tr>
136                                 <tr>
137                                         <th>data-theme</th>
138                                         <td>swatch letter (a-z)</td>
139                                 </tr>
140                                 <tr>
141                                         <th>data-title</th>
142                                         <td>string (title used when page is shown)</td>
143                                 </tr>
144                         </table>
145
146                         <h2><a href="../pages/page-anatomy.html">Content</a></h2>
147                         <p>Container with <code>data-role="content"</code></p>
148                         <table>
149                                 <tr>
150                                         <th>data-theme</th>
151                                         <td>swatch letter (a-z)</td>
152                                 </tr>
153                         </table>
154
155
156                         <h2><a href="../forms/docs-forms.html">Field container</a></h2>
157                         <p>Container with <code>data-role="fieldcontain"</code> wrapped around label/form element pair</p>
158
159                         <h2><a href="../forms/switch/">Flip toggle switch</a></h2>
160                         <p>Select with <code>data-role="slider"</code>, two options only</p>
161                         <table>
162                                 <tr>
163                                         <th>data-role</th>
164                                         <td>none (prevents auto-enhancement to use native control)</td>
165                                 </tr>
166                                 <tr>
167                                         <th>data-theme</th>
168                                         <td>swatch letter (a-z) - Added to the form element</td>
169                                 </tr>
170                                 <tr>
171                                         <th>data-track-theme</th>
172                                         <td>swatch letter (a-z) - Added to the form element</td>
173                                 </tr>
174                         </table>
175
176                         <h2><a href="../toolbars/docs-footers.html">Footer</a></h2>
177                         <p>Container with <code>data-role="footer"</code></p>
178                         <table>
179                                 <tr>
180                                         <th>data-id</th>
181                                         <td>string (unique id, useful in persistent footers)</td>
182                                 </tr>
183                                 <tr>
184                                         <th>data-position</th>
185                                         <td>fixed</td>
186                                 </tr>
187                                 <tr>
188                                         <th>data-theme</th>
189                                         <td>swatch letter (a-z)</td>
190                                 </tr>
191                         </table>
192
193                         <h2><a href="../toolbars/docs-headers.html">Header</a></h2>
194                         <p>Container with <code>data-role="header"</code></p>
195                         <table>
196                                 <tr>
197                                         <th>data-add-back-btn</th>
198                                         <td>true | <strong>false</strong> (auto add back button, header only)</td>
199                                 </tr>
200                                 <tr>
201                                         <th>data-back-btn-text</th>
202                                         <td>string</td>
203                                 </tr>
204                                 <tr>
205                                         <th>data-back-btn-theme</th>
206                                         <td>swatch letter (a-z)</td>
207                                 </tr>
208                                 <tr>
209                                         <th>data-position</th>
210                                         <td>fixed</td>
211                                 </tr>
212                                 <tr>
213                                         <th>data-theme</th>
214                                         <td>swatch letter (a-z)</td>
215                                 </tr>
216                                 <tr>
217                                         <th>data-title</th>
218                                         <td>string (title used when page is shown)</td>
219                                 </tr>
220                         </table>
221
222                         <h2><a href="../pages/page-links.html">Link</a></h2>
223                         <p>Links, including those with a <code>data-role="button"</code>, and form submit buttons share these attributes</p>
224                         <table>
225                                 <tr>
226                                         <th>data-ajax</th>
227                                         <td><strong>true</strong> | false</td>
228                                 </tr>
229                                 <tr>
230                                         <th>data-direction</th>
231                                         <td>reverse (reverse page transition animation)</td>
232                                 </tr>
233                                 <tr>
234                                         <th>data-dom-cache</th>
235                                         <td>true | <strong>false</strong></td>
236                                 </tr>
237                                 <tr>
238                                         <th>data-prefetch</th>
239                                         <td>true | <strong>false</strong></td>
240                                 </tr>
241                                 <tr>
242                                         <th>data-rel</th>
243                                         <td>back (to move one step back in history)<br />
244                                                 dialog (to open link styled as dialog, not tracked in history)<br />
245                                                 external (for linking to another domain)</td>
246                                 </tr>
247                                 <tr>
248                                         <th>data-transition</th>
249                                         <td><strong>slide</strong> | slideup | slidedown | pop | fade | flip</td>
250                                 </tr>
251                         </table>
252
253                         <h2><a href="../lists/docs-lists.html">Listview</a></h2>
254                         <p>OL or UL with <code>data-role="listview"</code></p>
255                         <table>
256                                 <tr>
257                                         <th>data-count-theme</th>
258                                         <td>swatch letter (a-z)</td>
259                                 </tr>
260                                 <tr>
261                                         <th>data-dividertheme</th>
262                                         <td>swatch letter (a-z)</td>
263                                 </tr>
264                                 <tr>
265                                         <th>data-filter</th>
266                                         <td>true | <strong>false</strong></td>
267                                 </tr>
268                                 <tr>
269                                         <th>data-filter-placeholder</th>
270                                         <td>string</td>
271                                 </tr>
272                                 <tr>
273                                         <th>data-filter-theme</th>
274                                         <td>swatch letter (a-z)</td>
275                                 </tr>
276                                 <tr>
277                                         <th>data-inset</th>
278                                         <td>true | <strong>false</strong></td>
279                                 </tr>
280                                 <tr>
281                                         <th>data-split-icon</th>
282                                         <td>home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search</td>
283                                 </tr>
284                                 <tr>
285                                         <th>data-theme</th>
286                                         <td>swatch letter (a-z)</td>
287                                 </tr>
288                         </table>
289
290                         <h2><a href="../lists/docs-lists.html">Listview item</a></h2>
291                         <p>LI within a listview</p>
292                         <table>
293                                 <tr>
294                                         <th>data-icon</th>
295                                         <td>home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search</td>
296                                 </tr>
297                                 <tr>
298                                         <th>data-role</th>
299                                         <td>list-divider</td>
300                                 </tr>
301                                 <tr>
302                                         <th>data-theme</th>
303                                         <td>swatch letter (a-z) - can also be set on individual LIs</td>
304                                 </tr>
305                         </table>
306
307                         <h2><a href="../pages/page-anatomy.html">Page</a></h2>
308                         <p>Container with <code>data-role="page"</code></p>
309                         <table>
310                                 <tr>
311                                         <th>data-close-btn-text</th>
312                                         <td>string (text for the close button, dialog only)</td>
313                                 </tr>
314                                 <tr>
315                                         <th>data-dom-cache</th>
316                                         <td>true | <strong>false</strong></td>
317                                 </tr>
318                                 <tr>
319                                         <th>data-id</th>
320                                         <td>string (unique id for the page)</td>
321                                 </tr>
322                                 <tr>
323                                         <th>data-fullscreen</th>
324                                         <td>true | false (used in conjunction with fixed toolbars)</td>
325                                 </tr>
326                                 <tr>
327                                         <th>data-overlay-theme</th>
328                                         <td>swatch letter (a-z) - overlay theme when the page is opened in a dialog</td>
329                                 </tr>
330                                 <tr>
331                                         <th>data-theme</th>
332                                         <td>swatch letter (a-z)</td>
333                                 </tr>
334                                 <tr>
335                                         <th>data-title</th>
336                                         <td>string (title used when page is shown)</td>
337                                 </tr>
338                         </table>
339
340                         <h2><a href="../forms/radiobuttons/">Radio button</a></h2>
341                         <p>Pairs of labels and inputs with <code>type="radio"</code> are auto-enhanced, no <code>data-role</code> required</p>
342                         <table>
343                                 <tr>
344                                         <th>data-role</th>
345                                         <td>none (prevents auto-enhancement to use native control)</td>
346                                 </tr>
347                                 <tr>
348                                         <th>data-theme</th>
349                                         <td>swatch letter (a-z) - Added to the form element</td>
350                                 </tr>
351                         </table>
352
353                         <h2><a href="../forms/selects/">Select</a></h2>
354                         <p>All <code>select</code> form elements are auto-enhanced, no <code>data-role</code> required</p>
355                         <table>
356                                 <tr>
357                                         <th>data-icon</th>
358                                         <td>home | delete | plus | arrow-u | arrow-d | check | gear | grid | star | custom | arrow-r | arrow-l | minus | refresh | forward | back | alert | info | search</td>
359                                 </tr>
360                                 <tr>
361                                         <th>data-iconpos</th>
362                                         <td><strong>left</strong> | right | top | bottom |  notext</td>
363                                 </tr>
364                                 <tr>
365                                         <th>data-inline</th>
366                                         <td>true | <strong>false</strong></td>
367                                 </tr>
368                                 <tr>
369                                         <th>data-native-menu</th>
370                                         <td><strong>true</strong> | false</td>
371                                 </tr>
372                                 <tr>
373                                         <th>data-overlay-theme</th>
374                                         <td>swatch letter (a-z) - overlay theme for non-native selects</td>
375                                 </tr>
376                                 <tr>
377                                         <th>data-placeholder</th>
378                                         <td>true | false - Add to the Option</td>
379                                 </tr>
380                                 <tr>
381                                         <th>data-role</th>
382                                         <td>none (prevents auto-enhancement to use native control)</td>
383                                 </tr>
384                                 <tr>
385                                         <th>data-theme</th>
386                                         <td>swatch letter (a-z) - Added to the form element</td>
387                                 </tr>   
388                         </table>
389                         <p>Multiple selects can be wrapped in a fieldset with a <code>data-role="controlgroup"</code> attribute for a vertically grouped set. Add the <code>data-type="horizontal"</code> attribute for the selects to sit side-by-side.</p>
390
391                         <h2><a href="../forms/slider/">Slider</a></h2>
392                         <p>Inputs with <code>type="range"</code> are auto-enhanced, no <code>data-role</code> required</p>
393                         <table>
394                                 <tr>
395                                         <th>data-role</th>
396                                         <td>none (prevents auto-enhancement to use native control)</td>
397                                 </tr>
398                                 <tr>
399                                         <th>data-theme</th>
400                                         <td>swatch letter (a-z) - Added to the form element</td>
401                                 </tr>
402                                 <tr>
403                                         <th>data-track-theme</th>
404                                         <td>swatch letter (a-z) - Added to the form element</td>
405                                 </tr>
406                         </table>
407
408                         <h2><a href="../forms/textinputs/">Text input &amp; Textarea</a></h2>
409                         <p>Input <code>type="text|number|search|etc."</code> or <code>textarea</code> elements are auto-enhanced, no <code>data-role</code> required</p>
410                         <table>
411                                 <tr>
412                                         <th>data-role</th>
413                                         <td>none (prevents auto-enhancement to use native control)</td>
414                                 </tr>
415                                 <tr>
416                                         <th>data-theme</th>
417                                         <td>swatch letter (a-z) - Added to the form element</td>
418                                 </tr>
419                         </table>
420
421                 </div><!--/content -->          
422
423         <div class="content-secondary">
424
425                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
426
427                                 <h3>More in this section</h3>
428
429                                 <ul data-role="listview"  data-theme="c" data-dividertheme="d">
430
431                                         <li data-role="list-divider">API</li>
432                                         <li><a href="../../docs/api/globalconfig.html">Configuring defaults</a></li>
433                                         <li><a href="../../docs/api/events.html">Events</a></li>
434                                         <li><a href="../../docs/api/methods.html">Methods &amp; Utilities</a></li>
435                                         <li data-theme="a"><a href="../../docs/api/data-attributes.html">Data attribute reference</a></li>
436                                         <li><a href="../../docs/api/themes.html">Theme framework</a></li>
437                                 </ul>
438                 </div>
439         </div>          
440
441 </div><!-- /content -->
442
443 <div data-role="footer" class="footer-docs" data-theme="c">
444                 <p>&copy; 2011 The jQuery Project</p>
445 </div>
446
447 </div><!-- /page -->
448
449 </body>
450 </html>