Experience excellent touch screen web page development acceleration slide and rebound, slide

Source: Internet
Author: User

Experience excellent touch screen web page development acceleration slide and rebound, slide
Accelerated slide and rebound css3 properties close to the naturalapp experience

A few days ago, the author published an article about mobile Web page development soft keyboard and fixed blog called: webapp front-end development soft keyboard and position: fixed for us inconvenience

I think the summary is quite good, but unfortunately, through learning and communication, there will soon be a better and more perfect solution, and it is still implemented by the native safari control, the code is very simple

overflow-y:auto;-webkit-overflow-scrolling:touch;

 

Highly Efficient system-level controls with hardware acceleration, simple but not simple

The code is very simple, but we can replace the webapp front-end development framework iscroll that we used to solve the problem of Ios soft keyboard and fixed.

The iscroll framework does solve our problems, but it also brings us a lot of sequelae and code processing troubles.

 

-Webkit-overflow-scrolling is implemented by the native safari control. The working principle is: on the container with this attribute, the system creates a uiscrollview, apply it to this element and use it as a rendering object, so that we can experience smooth touch screen sliding.

The performance on Ios is satisfactory, and the conflict between webpage sliding and area sliding is also well resolved.

 

Based on the above ideas, the fixed position of the suspension and scrolling Element Separation code Display
<! Doctype html> 

Someone may ask why the html and body must be added. Do these two attributes need to be added?

Scenario display:

Add both html and body

Neither html nor body is added or only one

The former is much less likely to trigger webpage slide than the latter. Try it on your own.

 

-Webkit-overflow-scrolling disadvantages

Of course, it also has its own shortcomings. Since a system-level control is created, there will inevitably be memory consumption. However, compared with a framework, its cost-effectiveness is self-evident.

The performance in Android is not satisfactory, so we just use it to replace the previous development framework iscroll to optimize the Ios experience.

 

The author's knowledge of-webkit-overflow-scrolling is still very short, and the opinions in the blog may not be comprehensive enough. You are welcome to help improve your understanding.

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.