Some experiences in Web development on mobile platforms

Source: Internet
Author: User

I just want to share some of my recent web development experience on the mobile platform with you.

 

1. iscroll Control

This control is a very good one developed using mobile WebKit to achieve the sliding effect. Http://cubiq.org/iscroll

It is written purely in JS and does not rely on other JS frameworks. The following examples show the effects of Safari on iPad:

Carousel image:

 

Sliding effect (similar to the Sina Weibo client, slide upwards to load asynchronously ):

Calendar controls similar to those of IOS:

 

You can expand many plug-ins Based on iscroll.

 

2. Mobile development events

 

In mobile development, many JS events are different from traditional development events,

For example: $ (document). BIND ('click', function (){

// Do something here

 

});

This definitely does not work in mobile development. You need to use touch events;

For example: $ (document). BIND ('touchend', function (){

// Do something here

 

});

Touchmove and so on.

 

For Dom control operations, such as $ (# ID). Live ('keyup', function (){

// Do something here

});

This is generally not used, probably because of jquery, which makes safari crash easily. Generally, it is replaced with an oninput event.

 

3. Mobile development framework

 

I personally think that if you want to develop a web platform for mobile platforms, you must be careful not to use jquery mobile. We mainly try to use many new features of WebKit and css3 to achieve some results. Currently, some mobile Web development platforms on the Internet are not very mature. If you are not a JS guru, try not to design JS frameworks in the project, even if you are familiar with jquery.

Because there are many. NET developers are not particularly fond of JavaScript and do not have enough patience to write Javascript. Therefore, when developing Web together, try to guide JS cainiao as much as possible, otherwise, the final Code cannot be maintained.

 

4. Display and load content

For mobile platform development, the corresponding content must be displayed on a page, which provides a good user experience. It involves switching many pages or content. At this time, the module cache and asynchronous loading are very important, and a good loading mode is very difficult. We recommend that you use a framework such as knockoutjs or jquery template to facilitate content separation between different modules.

 

 

 

I will share with you later.

 

 

 

 

 

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.