Revert "Export"
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / buttons / buttons-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 - Button options</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>Button basics</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
28                 <form action="#" method="get">
29
30                         <h2>Button basics</h2>          
31                 
32          <ul data-role="controlgroup" data-type="horizontal" class="localnav">
33                         <li><a href="buttons-types.html" data-role="button" data-transition="fade">Basics</a></li>
34                         <li><a href="buttons-options.html" data-role="button" data-transition="fade" class="ui-btn-active">Options</a></li>
35                         <li><a href="buttons-methods.html" data-role="button" data-transition="fade">Methods</a></li>
36                         <li><a href="buttons-events.html" data-role="button" data-transition="fade">Events</a></li>
37                 </ul>   
38                         
39                         <p>The following options apply to <strong>all buttons</strong>:</p>
40
41                 <dl>                    
42                         <dt><code>corners</code> <em>boolean</em></dt>
43                         <dd>
44                                 <p class="default">default: true</p>
45                                 <p>Applies the theme button border-radius if set to true. This option is also exposed as a data attribute: <code>data-corners=&quot;false&quot;</code></p>
46                                 <pre><code>$('a').buttonMarkup(<strong>{ corners: "false" }</strong>);</code></pre>
47                                 <a href="#" data-role="button" data-corners="false">No rounded corners</a>
48                         </dd>                   
49                         <dt><code>icon</code> <em>string</em></dt>
50                         <dd>
51                                 <p class="default">default: null</p>
52                                 <p>Applies an icon from the <a href="../buttons/buttons-icons.html">icon set</a>. This option is also exposed as a data attribute: <code>data-icon=&quot;star&quot;</code></p>
53                                 <pre><code>$('a').buttonMarkup(<strong>{ icon: "star" }</strong>);</code></pre>
54                                 <a href="#" data-role="button" data-icon="star">Star icon</a>
55                         </dd>
56                         
57                         <dt><code>iconpos</code> <em>string</em></dt>
58                         <dd>
59                                 <p class="default">default: "left"</p>
60                                 <p>Positions the icon in the button. Possible values: left, right, top, bottom, none, notext. The notext value will display an icon-only button with no text feedback. This option is also exposed as a data attribute: <code>data-iconpos=&quot;left&quot;</code></p>
61                                 <pre><code>$('a').buttonMarkup(<strong>{ iconpos: "right" }</strong>);</code></pre>
62                                 <a href="#" data-role="button" data-icon="star" data-iconpos="right">Star icon</a>
63                         </dd>
64                         
65                         <dt><code>iconshadow</code> <em>boolean</em></dt>
66                         <dd>
67                                 <p class="default">default: true</p>
68                                 <p>Applies the theme shadow to the button's icon if set to true. This option is also exposed as a data attribute: <code>data-iconshadow=&quot;false&quot;</code></p>
69                                 <pre><code>$('a').buttonMarkup(<strong>{ iconshadow: "false" }</strong>);</code></pre>
70                                 <a href="#" data-role="button"  data-icon="star" data-iconshadow="false">No icon shadow</a>
71                         </dd>
72                         
73                         <dt><code>inline</code> <em>boolean</em></dt>
74                         <dd>
75                                 <p class="default">default: null (false)</p>
76                                 <p>If set to true, this will make the button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the button is full width, regardless of the feedback content. Possible values: true, false. This option is also exposed as a data attribute: <code>data-inline=&quot;true&quot;</code></p>
77                                 <pre><code>$('a').buttonMarkup(<strong>{ inline: "true" }</strong>);</code></pre>
78                                 <a href="#" data-role="button" data-inline="true">Inline</a>
79                         </dd>
80                         
81                         <dt><code>mini</code> <em>boolean</em></dt>
82                         <dd>
83                                 <p class="default">default: null (false)</p>
84                                 <p>If set to true, this will display a more compact version of the button that uses less vertical height. Possible values: true, false. This option is also exposed as a data attribute: <code>data-mini=&quot;true&quot;</code></p>
85                                 <pre><code>$('a').buttonMarkup(<strong>{ mini: "true" }</strong>);</code></pre>
86                                 <a href="#" data-role="button" data-mini="true">Inline</a>
87                         </dd>
88                         
89                         <dt><code>shadow</code> <em>boolean</em></dt>
90                         <dd>
91                                 <p class="default">default: true</p>
92                                 <p>Applies the drop shadow style to the button if set to true. This option is also exposed as a data attribute: <code>data-shadow=&quot;false&quot;</code></p>
93                                 <pre><code>$('a').buttonMarkup(<strong>{ shadow: "false" }</strong>);</code></pre>
94                                 <a href="#" data-role="button" data-shadow="false">No button shadow</a>
95                         </dd>
96                         
97                         <dt><code>theme</code> <em>string</em></dt>
98                         <dd>
99                                 <p class="default">default: null, inherited from parent</p>
100                                 <p>Sets the color scheme (swatch) for all instances of this widget. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, it will inherit the same swatch color as it's parent container if not explicitly set. This option is also exposed as a data attribute: <code>data-theme=&quot;a&quot;</code></p>                  
101                                 <pre><code>$('a').buttonMarkup(<strong>{ theme: "a" }</strong>);</code></pre>
102                                 <a href="#" data-role="button" data-theme="a">Theme A</a>
103                         </dd>                                   
104                 </dl>   
105                 
106                 <div class="ui-body ui-body-e">
107                 <p>The following option applies only to <strong>form buttons</strong>, which are automatically initialized by the framework:</p>
108                 </div>
109                                 
110                 <dl>
111                         <dt><code>initSelector</code> <em>CSS selector string</em></dt>
112                         <dd>
113                                 <p class="default">default: "button, [type='button'], [type='submit'], [type='reset'], [type='image']"</p>
114                                 <p>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as form buttons. To change which elements are initialized, bind this option to the <a href="../api/globalconfig.html">mobileinit event</a>:</p>
115 <pre><code>$( document ).bind( "mobileinit", function(){
116    <strong>$.mobile.button.prototype.options.initSelector = ".myButtons";</strong>
117 });
118 </code></pre>
119                         </dd>                   
120                 </dl>   
121                 
122     
123         </form>
124         </div><!--/content-primary -->          
125         
126         <div class="content-secondary">
127                 
128                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
129                         
130                                 <h3>More in this section</h3>
131                                 
132                                 <ul data-role="listview" data-theme="c" data-dividertheme="d">                          
133                                         <li data-role="list-divider">Buttons</li>
134                                         <li data-theme="a"><a href="buttons-types.html">Button basics</a></li>
135                                         <li><a href="buttons-icons.html">Button icons</a></li>
136                                         <li><a href="buttons-inline.html">Inline buttons</a></li>
137                                         <li><a href="buttons-grouped.html">Grouped buttons</a></li>
138                                         <li><a href="buttons-themes.html">Theming buttons</a></li>      
139                                 </ul>
140                 </div>
141         </div>          
142
143 </div><!-- /content -->
144
145 <div data-role="footer" class="footer-docs" data-theme="c">
146                 <p>&copy; 2011-12 The jQuery Foundation</p>
147 </div>
148         
149 </div><!-- /page -->
150
151 </body>
152 </html>
153