Getting started with jQTouch plug-in for iPhone mobile phone Development

Source: Internet
Author: User

JQTouch is a jQuery plug-in that allows you to implement various common UI effects such as animation, list navigation, and default application styles on Mobile WebKit browsers of iPhone, iPod Touch, and other devices. With the increasing use of iPhone, iPod Touch and other devices, jQTouch undoubtedly reduces a lot of work for the development of mobile website, and has greatly improved style and compatibility.


JQTouch Official Website: http://www.jqtouch.com
Open the home page to download the latest plug-in package and some instance code. The following describes some simple jQTouch usage.
Getting started with jQTouch

1. Load the plug-in
First, include necessary script files and style files in the header of the page.
 

 
 
  1. <style type="text/css" media="screen">@import "jqtouch/jqtouch.min.css";</style> 
  2. <style type="text/css" media="screen">@import "themes/jqt/theme.min.css";</style> 
  3. <script src="jqtouch/jquery.1.3.2.min.js" type="text/javascript" charset="utf-8"></script> 
  4. <script src="jqtouch/jqtouch.min.js" type="application/x-javascript" charset="utf-8"></script> 

The corresponding files can be found in the downloaded code package.
2. initialize jQTouch

 
 
  1. <script type="text/javascript" charset="utf-8"> 
  2. var jQT = new $.jQTouch({  
  3. icon: 'jqtouch.png',  
  4. addGlossToIcon: false,  
  5. startupScreen: 'jqt_startup.png',  
  6. statusBar: 'black',  
  7. preloadImages: [  
  8. 'img/back_button.png',  
  9. 'img/back_button_clicked.png',  
  10. 'img/button_clicked.png',  
  11. 'img/grayButton.png',  
  12. 'img/whiteButton.png',  
  13. 'img/loading.gif'  
  14. ]  
  15. });  
  16. </script> 

3. Usage
When the jQTouch plug-in is loaded in HTML, the first HTML object is displayed by default. Other HTML objects are not displayed, such as div1, div2, and div3 under the body... At this time, only the first div is displayed, and none of the other div is displayed. in the control of the page tag,
It is controlled by class and id. For example, by default, jQTouch configures eight animations: slide, slideup, and dissolve ), fade, flip, pop, swap, and cube ).
To present these animation effects, you can use the following method:
 

 
 
  1. <a class="slide" href="#animdemo">Slide</a> 
  2. <a class="slideup" href="#animdemo">Slide Up</a> 
  3. <a class="dissolve" href="#animdemo">Dissolve</a> 
  4. <a class="fade" href="#animdemo">Fade</a> 
  5. <a class="flip" href="#animdemo">Flip</a> 
  6. <a class="pop" href="#animdemo">Pop</a> 
  7. <a class="swap" href="#animdemo">Swap</a> 
  8. <a class="cube" href="#animdemo">Cube</a> 

The id pointed to in href is the HTML object to be displayed after clicking the link. This requires that the page contains an HTML object whose id is animdemo.
Of course, the implementation of these animation effects can also be customized during initialization. The plug-in provides us with many optional parameters. The new version has improved the scalability of the system:
Improved 3D flip transition
Callback events: Transition of the entire page, swipe events, and changes in the direction
Add Demo: Clock, To-Do, and some main functions
Topic: currently, the subject is gray with Apple and jQuery)
The page effect implemented by the jQTouch plug-in is really amazing. Some iPhone or iPod Touch friends may wish to give it a try.

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.