$. Mobile. buttonMarkup method in jQuery mobile, jquerymobilebutton
Recently, many netizens mentioned the use of the $. mobile. buttonMarkup () method in the group. Here I will describe how to use the api, and you will be able to solve the problem after reading the blog. If any error occurs, leave a message to indicate it!
The methods exposed by jQuery Mobile are referenced by $. mobile.
$. Mobile. buttonMarkup (options, overwriteClasses) Add a button style element
Options is an object and overwriteClasses is a boolean type. The default value is false. If it is set to true, buttonmarkup () discards all styles. If it is set to false, add styles based on existing styles.
The properties of the options object are described as follows::
Corners attributes: Sets the rounded corner. boolean type. The default value is true. If the value is true, the ui-corner-all style is added. If the value is false, the ui-corner-all style is deleted. Its usage is similar to data-corners = "false ".
Icon properties: Set the icon. It is of the string type. The default value is "". It is similar to data-icon = "arrow-r ". Similar to adding the "ui-icon-" attribute to the class.
Iconpos attributes: Set the icon position, string type, default value: "left ". It is similar to data-iconpos = "right ". It is similar to adding the "ui-btn-icon-" attribute to the class.
Iconshadow attributes: Specifies the shadow icon. It is of the boolean type. The default value is false. This option is 1.4.0 and will be deleted in 1.5.0. Its usage is similar to data-iconshadow = "true ". It is similar to adding the "ui-shadow-icon" attribute to the class.
Inline attributes: Set the row style of the element. boolean type. The default value is false. It is similar to data-inline = "true ". It is similar to adding the "ui-btn-inline" attribute to the class.
Mini attributes: Set a small style of the element, boolean type. The default value is false. It is similar to data-mini = "true ". Similar to adding the "ui-mini" attribute to the class.
Shadow attributes: Specifies the shadow of an element. It is a Boolean value. The default value is true. Its usage is similar to data-shadow = "false ". It is similar to adding the "ui-shadow" attribute to the class.
Theme attributes: Set the topic. The default value is null. It is inherited from the parent element and belongs to the string type. It is similar to data-theme = "B ". Similar to adding the "ui-btn-" attribute to the class, for example, ui-btn-B.
Use:
$ ("# MyAnchor"). buttonMarkup ({corners: false}); // cancel the rounded corner
$ ("# MyAnchor"). buttonMarkup ({shadow: false}); // sets the shadow.
$ ("# MyAnchor"). buttonMarkup ({corners: true}); // set the rounded corner
If you do not understand, please join the QQ group: 135430763 to learn together!