JQuery Mobile button icon

Source: Internet
Author: User

JQuery Mobile offers a set of icons to make your buttons more appealing.

1. Add an icon for the JQuery Mobile button

To add an icon to your button, use the Data-icon property: ( You can also use the Data-icon property in the <button> or <input> element.) )

<DivData-role= "page"ID= "Pageone">        <DivData-role= "Content">            <ahref="#"Data-role= "button"Data-icon= "Search">Search</a>        </Div></Div> 

Below we list some of the available icons for jQuery Mobile:

for complete information on the jquery Mobile button icon, visit the jquery Mobile icon Reference manual

2. Position of position icon

You can also specify where the icon is placed: top, right, bottom, or left. Use the Data-iconpos property to specify the position: ( by default, the icons in all buttons are placed left.) )

<DivData-role= "page"ID= "Pageone">        <DivData-role= "Content">            <P>Positioning icons:</P>            <ahref= "#link"Data-role= "button"Data-icon= "Search"Data-iconpos= "Top"Data-inline= "true">Top</a>            <ahref= "#link"Data-role= "button"Data-icon= "Search"Data-iconpos= "Right">Right</a>            <ahref= "#link"Data-role= "button"Data-icon= "Search"Data-iconpos= "Bottom">Bottom</a>            <ahref= "#link"Data-role= "button"Data-icon= "Search"Data-iconpos= "Left"Data-inline= "true">Left</a>        </Div></Div> 

3. Show Icons only

If you only need to display the icon, set Data-iconpos to "Notext":

<DivData-role= "page"ID= "Pageone">        <DivData-role= "Content">            <P>Only the icon has no text button.</P>            <P><b>Comments:</b>Move the mouse pointer over the icon to see the prompt text:</P>            <ahref= "#link"Data-role= "button"Data-icon= "Search"Data-iconpos= "Notext">Search</a>        </Div></Div> 

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.