Export 0.1.45
[framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.1.0 / docs / forms / selects / 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 - Select options</title>
7         <link rel="stylesheet"  href="../../../css/themes/default/jquery.mobile.css" />
8         <link rel="stylesheet" href="../../_assets/css/jqm-docs.css"/>
9         <script src="../../../experiments/themeswitcher/jquery.mobile.themeswitcher.js"></script>
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>Select Menus</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>Select menus</h2>
31                         
32                         <ul data-role="controlgroup" data-type="horizontal" class="localnav">
33                                 <li><a href="index.html" data-role="button" data-transition="fade">Basics</a></li>
34                                 <li><a href="options.html" data-role="button" data-transition="fade" class="ui-btn-active">Options</a></li>
35                                 <li><a href="methods.html" data-role="button" data-transition="fade">Methods</a></li>
36                                 <li><a href="events.html" data-role="button" data-transition="fade">Events</a></li>
37                         </ul>
38                         
39                         <p>The select menu plugin has the following options:</p>                        
40                         
41
42                 <dl>
43                         
44                         <dt><code>corners</code> <em>boolean</em></dt>
45                         <dd>
46                                 <p class="default">default: true</p>
47                                 <p>Applies the theme button border-radius to the select button if set to true. This option is also exposed as a data attribute: <code>data-corners=&quot;false&quot;</code></p>
48                                 <pre><code>$('select').selectmenu(<strong>{ corners: "false" }</strong>);</code></pre>
49                         </dd>                   
50                         <dt><code>icon</code> <em>string</em></dt>
51                         <dd>
52                                 <p class="default">default: "arrow-down"</p>
53                                 <p>Applies an icon from the <a href="../../buttons/buttons-icons.html">icon set</a> to the custom button. This option is also exposed as a data attribute: <code>data-icon=&quot;star&quot;</code></p>
54                                 <pre><code>$('select').selectmenu(<strong>{ icon: "star" }</strong>);</code></pre>
55                         </dd>
56                         
57                         <dt><code>iconpos</code> <em>string</em></dt>
58                         <dd>
59                                 <p class="default">default: "right"</p>
60                                 <p>Position of the icon in the select button. Possible values: left, right, none, notext. The notext value will display the select as 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>$('select').selectmenu(<strong>{ iconpos: "left" }</strong>);</code></pre>
62                         </dd>
63                         
64                         <dt><code>iconshadow</code> <em>boolean</em></dt>
65                         <dd>
66                                 <p class="default">default: true</p>
67                                 <p>Applies the theme shadow to the select button if set to true. This option is also exposed as a data attribute: <code>data-iconshadow=&quot;false&quot;</code></p>
68                                 <pre><code>$('select').selectmenu(<strong>{ iconshadow: "false" }</strong>);</code></pre>
69                         </dd>
70                         
71                         <dt><code>initSelector</code> <em>CSS selector string</em></dt>
72                         <dd>
73                                 <p class="default">default: "select:not(:jqmData(role='slider'))"</p>
74                                 <p>This is used to define the selectors (element types, data roles, etc.) that will automatically be initialized as select menus. To change which elements are initialized, bind this option to the <a href="../../api/globalconfig.html">mobileinit event</a>:</p>
75                                 <pre><code>$( document ).bind( "mobileinit", function(){
76         <strong>$.mobile.selectmenu.prototype.options.initSelector = ".myselect";</strong>
77 });
78 </code></pre>
79                         </dd>
80                         
81                         <dt><code>inline</code> <em>boolean</em></dt>
82                         <dd>
83                                 <p class="default">default: null (false)</p>
84                                 <p>If set to true, this will make the select button act like an inline button so the width is determined by the button's text. By default, this is null (false) so the select 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>
85                                 <pre><code>$('select').selectmenu(<strong>{ inline: "true" }</strong>);</code></pre>
86                         </dd>
87                         
88                         <dt><code>mini</code> <em>boolean</em></dt>
89                         <dd>
90                                 <p class="default">default: false</p>
91                                 <p>Sets the size of the element to a more compact, <a href="../forms-all-mini.html">mini version</a>. This option is also exposed as a data attribute: <code>data-mini=&quot;true&quot;</code></p>              
92                                 <pre><code>$('select').selectmenu(<strong>{ mini: "true" }</strong>);</code></pre>
93                                 
94                         <dt><code>nativeMenu</code> <em>boolean</em></dt>
95                         <dd>
96                                 <p class="default">default: true</p>
97                                 <p>When set to true, clicking the custom-styled select menu will open the native select menu which is best for performance. If set to false, the custom select menu style will be used instead of the native menu. This option is also exposed as a data attribute: <code>data-native-menu=&quot;false&quot;</code></p>
98                                 <pre><code>$('select').selectmenu(<strong>{ nativeMenu: "false" }</strong>);</code></pre>
99                         </dd>
100                         
101                         <dt><code>overlayTheme</code> <em>string</em></dt>
102                         <dd>
103                                 <p class="default">default: a</p>
104                                 <p>Sets the color of the overlay layer for the dialog-based custom select menus and the outer border of the smaller custom menus. It accepts a single letter from a-z that maps to the swatches included in your theme. By default, the content block colors for swatch A will be used for the overlays. This option is also exposed as a data attribute: <code>ui-body-d</code></p>
105                                 <pre><code>$('select').selectmenu(<strong>{ overlayTheme: "d" }</strong>);</code></pre>
106                         </dd>
107                         
108                         <dt><code>preventFocusZoom</code> <em>boolean</em></dt>
109                         <dd>
110                                 <p class="default">default: true on iOS platforms</p>
111                                 <p>This option disables page zoom temporarily when a custom select is focused, which prevents iOS devices from zooming the page into the select. By default, iOS often zooms into form controls, and the behavior is often unnecessary and intrusive in mobile-optimized layouts. This option is also exposed as a data attribute: <code>data-prevent-focus-zoom=&quot;true&quot;</code></p>                            
112                                 <pre><code>$('select').selectmenu(<strong>{ preventFocusZoom: true }</strong>);</code></pre>
113                         </dd>
114                         
115                         
116                         <dt><code>shadow</code> <em>boolean</em></dt>
117                         <dd>
118                                 <p class="default">default: true</p>
119                                 <p>Applies the drop shadow style to the select button if set to true. This option is also exposed as a data attribute: <code>data-shadow=&quot;false&quot;</code></p>
120                                 <pre><code>$('select').selectmenu(<strong>{ shadow: "false" }</strong>);</code></pre>
121                         </dd>
122                         
123                         <dt><code>theme</code> <em>string</em></dt>
124                         <dd>
125                                 <p class="default">default: null, inherited from parent</p>
126                                 <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>                          
127                                 <pre><code>$('select').selectmenu(<strong>{ theme: "a" }</strong>);</code></pre>
128                         </dd>
129                         
130                 </dl>   
131     
132         </form>
133         </div><!--/content-primary -->          
134         
135         <div class="content-secondary">
136                 
137                 <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d">
138                         
139                                 <h3>More in this section</h3>
140                                 
141                                 <ul data-role="listview" data-theme="c" data-dividertheme="d">
142                                 
143                                         <li data-role="list-divider">Form elements</li>
144                                         <li><a href="../docs-forms.html">Form basics</a></li>
145                                         <li><a href="../forms-all.html">Form element gallery</a></li>
146                                         <li><a href="../forms-all-mini.html">Mini form element gallery</a></li>
147                                         <li><a href="../textinputs/index.html">Text inputs</a></li>
148                                         <li><a href="../search/">Search input</a></li>
149                                         <li><a href="../slider/">Slider</a></li>
150                                         <li><a href="../switch/">Flip toggle switch</a></li>
151                                         <li><a href="../radiobuttons/">Radio buttons</a></li>
152                                         <li><a href="../checkboxes/">Checkboxes</a></li>
153                                         <li data-theme="a"><a href="index.html">Select menus</a></li>
154                                         <li><a href="../forms-themes.html">Theming forms</a></li>
155                                         <li><a href="../forms-all-native.html">Native form elements</a></li>
156                                         <li><a href="../forms-sample.html">Submitting forms</a></li>
157                                         
158         
159                                 </ul>
160                 </div>
161         </div>          
162
163 </div><!-- /content -->
164
165 <div data-role="footer" class="footer-docs" data-theme="c">
166                 <p>&copy; 2011-12 The jQuery Foundation</p>
167 </div>
168         
169 </div><!-- /page -->
170
171 </body>
172 </html>
173