BC Cash Disk Development Mobile End 300ms Latency Solution

Source: Internet
Author: User

Method One: BC Cash disk Development prohibit scaling (set in meta tag) Chorm and Firfox support, Safari more trouble He also has double-click Zoom and double-click Scroll action

<meta name= "viewport" content= "user-scalable=no,initial-scale=1,maximun-scale=1"/>

The page is not scalable, so double-clicking the Zoom function makes no sense, and the browser can disable the default double-click Scaling Behavior and remove the 300ms click Delay.

Cons: You must disable scaling completely to achieve the goal, but usually we want to be able to zoom with two fingers

Method Two: Change the default viewport width (set in the META tag) Chorm and Firfox support, Safari more trouble he has double-click Zoom and double-click Scroll action

<meta name= "viewport" content= "Width=device-width"/>

If you can identify a site that is responsive, the mobile browser can automatically disable the double-click Scaling Behavior and remove the 300ms click Delay.

Set the META tag above, then the browser can assume that the site has been adapted to the mobile end of the optimization, there is no need to double-click operation.

Benefit: Instead of disabling scaling completely, the default double-click scaling behavior of the browser is disabled, but the user can still zoom the page with a two-finger zoom operation.

Method Three: CSS touch-action ie support

Touch-action: Specifies the default behavior of the user agent (browser) that can be triggered on the corresponding element.

Setting the property value to Touch-action:none means that actions on that element do not trigger any default behavior of the user agent. There is no need for a 300ms delay judgment.

Method Four: Fastclick is a lightweight library specifically designed to solve the problem of 300ms click Latency in Mobile browsers.

Principle: When a Touchend event is detected, a click event is immediately signaled through a DOM custom event, and the Click event issued after 300ms is blocked.

BC Cash Disk Development Mobile End 300ms Latency Solution

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.