$. Mobile. buttonMarkup method in jQuery mobile, jquerymobilebutton

Source: Internet
Author: User

$. 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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.