JQuery Mobile Tutorials: Web page button Instance detailed

Source: Internet
Author: User

Article Introduction: compared to other components, buttons are the most basic and common, what exactly is it like in the jquery mobile system?

Compared to other components, buttons are the most basic and common, what exactly is it like in the jquery mobile system? We use the "question answer" approach to the preliminary understanding:

1. What are the two types of buttons?

Common:

<button>button</button> <input type= "button" value= "input button"/> <input type= "Submit" value= Input Submit "/> <input type=" reset "value=" input reset "/> <input type=" image "value=" Input image "/>

Icon:

Link button:

<a data-role= "button" > Link button </a>

Icon:

Description
1, the common buttons do not need to add any additional properties can be automatically enhanced
2, for links, need to add data-role= "button" to enhance the button
3, the default above enhancements to block-level elements

2, how to set the inline elements?

Take the link button for example:

<a data-role= "button" data-inline= "true" > Inline link button 1</a> <a data-role= "button" data-inline= "true" > Inline link button 2</a>

Icon:

Description: Add Data-inline= "true" property to

3, for automatically enhanced type of button, can be disabled?

Take the button label as an example:

Disable automatic enhancement
	

Description: Add data-role= "None" property to

4, how to set the icon button?

Take the link button for example:

<a data-icon= "Home" data-role= "button" > Homepage icon button </a> <a data-icon= "Search" data-role= "button" > Search icon button </a> <a data-icon= "plus" data-role= "button" > Add icon button </a> <a data-icon= "minus" data-role= "button" > Reduce icon button </a> <a data-icon= "Delete" data-role= "button" > Delete icon button </a> <a data-icon= "Refresh" data-role= "button" > Refresh icon button </a> <a data-icon= "alert" data-role= "button" > Warning icon button </a>

Icon:

Description
1, add data-icon= "Home" properties to generate a button with the home icon
2, the default icon is left

5, how to set the location of the icon button?

Take the link button for example:

<a data-icon= "Home" data-role= "button" > Homepage icon button (default left) </a> <a data-icon= "" "data-role=" button " data-iconpos= "Top" > Homepage icon button (upper) </a> <a data-icon= "Home" data-role= "button" data-iconpos= "Bottom" > Home icon Button (next) </a> <a data-icon= "Home" data-role= "button" data-iconpos= "right" > Homepage icon button (right-hand) </a> <a Data-icon= "Home" data-role= "button" data-iconpos= "Notext" > No content Text </a>

Icon:

Description: Add the properties of data-iconpos= "top" to generate a button with a home icon (live)

6, how to set the button only icon?

Take the link button for example:

<a data-role= "button" data-icon= "Home" data-iconpos= "Notext" > Only icons, no text, no more writing </a>

Icon:

Description: Add data-iconpos= "Notext" properties to produce buttons with only icons

7, how to set the button of the custom icon?

Take the link button for example:

<a data-role= "button" data-icon= "Custom" > Customize icon button </a>

Description
1, add the attribute of data-iconpos= "Custom"
2, add CSS style:

. ui-icon-custom{background:;}
8, how to set the group button?
<div data-role= "Controlgroup" > <a data-role= "button" >js</a> <a data-role= "button" >css</a > <a data-role= "button" >html</a> <a data-role= "button" >ps</a> </div>

Icon:

Description
1, to the container to add data-role= "Controlgroup" Properties
2, the default is vertical arrangement

9, how to set the Horizontal grouping button?
<div data-role= "Controlgroup" data-type= "horizontal" > <a data-role= "button" >js</a> <a data-role = "button" >css</a> <a data-role= "button" >html</a> <a data-role= "button" >ps</a> < /div>

Icon:

Description: Add the data-type= "horizontal" property to the container

Demo



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.