Small white Learn jQuery mobile "building cross-platform App:jquery Mobile mobile app" Serial Five (button plus icon)

Source: Internet
Author: User

In the navigation bar used in example 5-4, the icon's style has been added to the button, but there is no way to describe the button's icon. The following intercepts the code in the navigation bar section of example 5-4:

<divdata-role= "Footer" ><div  data-role= "NavBar" data-grid= "C" >   <ul>                     <li>< A id= "chat" href= "#" data-icon= "Custom" ></a></li>                     <li><a id= "Email" href= "#" data-icon= " Custom > Contacts </a></li>                     <li><a id= "Skull" href= "#" data-icon= "Custom" > Find Friends </a> </li>                     <li><a id= "Beer" href= "#" data-icon= "Custom" > Settings </a></li>         </ul>   </div></div>

The navigation bar section of Style 6-2 is seen.


Figure 6-2 Style of the navigation bar

At that time, I mentioned that the default icon for button was used, and this icon was determined by the attribute data-icon= "Custom", which is one of the default icons that jquery Mobile has prepared for developers. Next, you'll learn how to control the button's icon on the page with the Data-icon property.

"Example 6-2 adds an icon to the button in the trailing bar"

<! DOCTYPE html> <!--declaration html 5-->

As seen in the results of the execution 6-3.


Figure 6-3 Button's icon

Although there is a very big gap with the well-designed icons, they are lot better a lot more than the bare cross forks of the past. These icons are some of the most suitable icons for the current button text in several sets of charts given by jquery Mobile, and in addition to these icons, JQuery Mobile has prepared a total of 17 other icon styles for developers, which I have organized in table 6-1.




The Jquerymobile availability is getting higher, the entry threshold low, and the ability to write less code to create a mobile-friendly interface. "Building cross-platform App:jquery Mobile mobile Application Practice" This book uses an example-driven approach to introduce the app development under Jquerymobile, which provides more than 70 practical cases to teach readers to carry out mobile development, Finally, through 6 small projects to review and consolidate the knowledge points learned. Want to communicate with the author, add Q Group: 348632872, the author is here waiting for you to come.


Small white Learn jQuery mobile "building cross-platform App:jquery Mobile mobile app" Serial Five (button plus icon)

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.