upload tizen1.0 source
[framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.0.1pre / 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/" />
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>Button basics</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">
24                 <div class="content-primary">
25
26                 <form action="#" method="get">
27
28                         <h2>Button basics</h2>          
29                 
30          <ul data-role="controlgroup" data-type="horizontal" class="localnav">
31                         <li><a href="buttons-types.html" data-role="button" data-transition="fade">Basics</a></li>
32                         <li><a href="buttons-options.html" data-role="button" data-transition="fade" class="ui-btn-active">Options</a></li>
33                         <li><a href="buttons-methods.html" data-role="button" data-transition="fade">Methods</a></li>
34                         <li><a href="buttons-events.html" data-role="button" data-transition="fade">Events</a></li>
35                 </ul>   
36                         
37                         <p>The following options apply to <strong>all buttons</strong>:</p>
38
39                 <dl>                    
40                         <dt><code>corners</code> <em>boolean</em></dt>
41                         <dd>
42                                 <p class="default">default: true</p>
43                                 <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>
44                                 <pre><code>$('a').buttonMarkup(<strong>{ corners: "false" }</strong>);</code></pre>
45                                 <a href="#" data-role="button" data-corners="false">No rounded corners</a>
46                         </dd>                   
47                         <dt><code>icon</code> <em>string</em></dt>
48                         <dd>
49                                 <p class="default">default: null</p>
50                                 <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>
51                                 <pre><code>$('a').buttonMarkup(<strong>{ icon: "star" }</strong>);</code></pre>
52                                 <a href="#" data-role="button" data-icon="star">Star icon</a>
53                         </dd>
54                         
55                         <dt><code>iconpos</code> <em>string</em></dt>
56                         <dd>
57                                 <p class="default">default: "left"</p>
58                                 <p>Positions the icon in the button. Possible values: left, right, 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>
59                                 <pre><code>$('a').buttonMarkup(<strong>{ iconpos: "right" }</strong>);</code></pre>
60                                 <a href="#" data-role="button" data-icon="star" data-iconpos="right">Star icon</a>
61                         </dd>
62                         
63                         <dt><code>iconshadow</code> <em>boolean</em></dt>
64                         <dd>
65                                 <p class="default">default: true</p>
66                                 <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>
67                                 <pre><code>$('a').buttonMarkup(<strong>{ iconshadow: "false" }</strong>);</code></pre>
68                                 <a href="#" data-role="button"  data-icon="star" data-iconshadow="false">No icon shadow</a>
69                         </dd>
70                         
71                         <dt><code>inline</code> <em>boolean</em></dt>
72                         <dd>
73                                 <p class="default">default: null (false)</p>
74                                 <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>
75                                 <pre><code>$('a').buttonMarkup(<strong>{ inline: "true" }</strong>);</code></pre>
76                                 <a href="#" data-role="button" data-inline="true">Inline</a>
77                         </dd>
78                         
79                         <dt><code>shadow</code> <em>boolean</em></dt>
80                         <dd>
81                                 <p class="default">default: true</p>
82                                 <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>
83                                 <pre><code>$('a').buttonMarkup(<strong>{ shadow: "false" }</strong>);</code></pre>
84                                 <a href="#" data-role="button" data-shadow="false">No button shadow</a>
85                         </dd>
86                         
87                         <dt><code>theme</code> <em>string</em></dt>
88                         <dd>
89                                 <p class="default">default: null, inherited from parent</p>
90                                 <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>                  
91                                 <pre><code>$('a').buttonMarkup(<strong>{ theme: "a" }</strong>);</code></pre>
92                                 <a href="#" data-role="button" data-theme="a">Theme A</a>
93                         </dd>                                   
94                 </dl>   
95                 
96                 <div class="ui-body ui-body-e">
97                 <p>The following option applies only to <strong>form buttons</strong>, which are automatically initialized by the framework:</p>
98                 </div>
99                                 
100                 <dl>
101                         <dt><code>initSelector</code> <em>CSS selector string</em></dt>
102                         <dd>
103                                 <p class="default">default: "button, [type='button'], [type='submit'], [type='reset'], [type='image']"</p>
104                                 <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>
105 <pre><code>$( document ).bind( "mobileinit", function(){
106    <strong>$.mobile.button.prototype.options.initSelector = ".myButtons";</strong>
107 });
108 </code></pre>
109                         </dd>                   
110                 </dl>   
111                 
112     
113         </form>
114         </div><!--/content-primary -->          
115         
116         <div class="content-secondary">
117                 
118                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
119                         
120                                 <h3>More in this section</h3>
121                                 
122                                 <ul data-role="listview" data-theme="c" data-dividertheme="d">                          
123                                         <li data-role="list-divider">Buttons</li>
124                                         <li data-theme="a"><a href="buttons-types.html">Button basics</a></li>
125                                         <li><a href="buttons-icons.html">Button icons</a></li>
126                                         <li><a href="buttons-inline.html">Inline buttons</a></li>
127                                         <li><a href="buttons-grouped.html">Grouped buttons</a></li>
128                                         <li><a href="buttons-themes.html">Theming buttons</a></li>      
129                                 </ul>
130                 </div>
131         </div>          
132
133 </div><!-- /content -->
134
135 <div data-role="footer" class="footer-docs" data-theme="c">
136                 <p>&copy; 2011 The jQuery Project</p>
137 </div>
138         
139 </div><!-- /page -->
140
141 </body>
142 </html>
143