Button Widgetversion added: 1.0
Description: Creates a button widget
The jQuery UI button widget is bundled in jQuery Mobile with some changes. Thus, its API documentation fully describes its functionality.
Options
corners
true
This option is also exposed as a data attribute: data-corners="false"
.
Note: button
option is deprecated in 1.5 and will be removed in 1.6
Initialize the button with the corners
option specified:
1
2
3
|
|
Get or set the corners
option, after initialization:
1
2
3
4
5
|
|
enhanced
false
This option is also exposed as a data attribute: data-enhanced="true"
.
Initialize the button with the enhanced
option specified:
1
2
3
|
|
Get or set the enhanced
option, after initialization:
1
2
3
4
5
|
|
icon
null
The .buttonMarkup() documentation contains a reference of all the icons available in the default theme.
This option is also exposed as a data attribute: data-icon="star"
.
Initialize the button with the icon
option specified:
1
2
3
|
|
Get or set the icon
option, after initialization:
1
2
3
4
5
|
|
iconpos
"left"
This option is also exposed as a data attribute: data-iconpos="right"
.
Note: button
option is deprecated in 1.5 and will be removed in 1.6
initSelector
See below
The default initSelector
for the button widget is:
1
|
|
Note: This option is deprecated in 1.4.0 and will be removed in 1.5.0.
As of jQuery Mobile 1.4.0, the initSelector
is no longer a widget option. Instead, it is declared directly on the widget prototype. Thus, you may specify a custom value by handling the mobileinit
event and overwriting the initSelector
on the prototype:
1
2
3
|
|
Note: Remember to attach the mobileinit
handler after you have loaded jQuery, but before you load jQuery Mobile, because the event is triggered as part of jQuery Mobile's loading process.
The value of this option is a jQuery selector string. The framework selects elements based on the value of this option and instantiates button widgets on each of the resulting list of elements.
(version deprecated: 1.4.0)inline
null (false)
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: data-inline="true"
.
Note: button
option is deprecated in 1.5 and will be removed in 1.6
mini
null (false)
true
, this will display a more compact version of the button that uses less vertical height by applying the ui-mini
class to the outermost element of the button widget.
Note: mini
option is deprecated in 1.5 and will be removed in 1.6
This option is also exposed as a data attribute: data-mini="true"
.
shadow
true
This option is also exposed as a data attribute: data-shadow="false"
.
Note: button
option is deprecated in 1.5 and will be removed in 1.6
theme
null, inherited from parent
Possible values: swatch letter (a-z).
This option is also exposed as a data attribute: data-theme="b"
.
Initialize the button with the theme
option specified:
1
2
3
|
|
Get or set the theme
option, after initialization:
1
2
3
4
5
|
|
wrapperClass
null
This option is also exposed as a data attribute: data-wrapper-class="custom-class"
.
Note: button
option is deprecated in 1.5 and will be removed in 1.6