an article in the mobile browser translates 300ms delay practical article, the original address http://updates. Html5rocks.com/2013/12/300ms-tap-delay-gone-away
Remove 300ms Click Latency on your mobile device browser
You can find very much about the site user experience on the site in order to be fast and smooth. Lower the 10ms or 90ms article somewhere. Unfortunately, it is. On a touchscreen-based cross-platform mobile browser, there is an artificial 300ms delay when touching or tapping an object, which is 300ms after the browser feels like a click event. This problem is one of the main culprits when people feel that mobile Web applications are slower than native applications.
However, in Chrome for Android. Now it's the test version number, which has been removed from the site that has been optimized for mobile. And still support two finger zoom!
This optimization can be used on whatever site, just add the following sentence to be able to
<metaname="Viewport"content="Width=device-width"]]>
(or other meta-definitions equivalent to viewport <= device-width)
Why do click events have a 300ms delay?
If you visit a site that is not optimized for mobile devices, the browser shrinks the page so that you can see the entire width of the page, and you can pinch to zoom or double-click something to read the content. Double click is the performance killer, because each click we have to wait to know whether it is a double-click event, the wait time is 300ms, the following is the implementation process:1.Touchstart2.Touchend3.Wait 300ms in case of another tap4.ClickThis delay applies not only to JavaScript click events, but also to other click-based user interactions. such as links and form controls.
You cannot simply cancel this delay through the touchend listener, and in a mobile browser other than chrome 32, compare the following sample using the Click events using the Touchend events Click the row to change its color.
The touchend implementation is faster, but still triggers a delay when the browser scrolls the page. This is because the specification does not define what can be canceled in the touch event process. The latest version of IOS Safari, Firefox, IE, and the old version number of Android browser triggers touchend after the page scrolls. and Chrome won't.
the Microsoft ' s pointerevents spec did the right thing. Specifies that Pointerup is not triggered when the underlying event (such as page scrolling) occurs. However. IE only supports mouse events right now, although Chrome has made a proposal for this issue.
Even so. The 300ms delay is also canceled only on the site where all links, form elements, and JavaScript interactions use the listener.
How does Chrome get rid of 300ms latency? The Android version number for Chrome and Firefox has removed the 300ms latency of the tap event for pages that have added the following meta
<metaname="Viewport"content="Width=device-width, User-scalable=no"]]>
The Web page that added this meta cannot be scaled, so double-clicking scaling is no longer an available user interaction, so there is no need to wait for a double-click.
However, we lost the same two finger pinch zoom function.
when we look at the pictures. Some small text, or a few buttons or links next to each other, the two-finger zoom function is very practical. This is an out-of-the-box ease of use feature.
Suppose a site joins the
<metaname="Viewport"content="Width=device-width"]]>
... A bit is scaled when you double-click. is not particularly noticeable in quantity.
Double-clicking will change back to the original. We found this feature to be of little use to mobile-optimized sites. So I deleted it! This means that we can directly think of the tap event as the Click event, but we retain two-finger scaling (retain pinch-zooming).
can such changes be used now?we don't think so. So we've released the Chrome test version number that includes this feature so that users can experience new features and give us feedback.
we imagined that this feature would affect the user's scene:
has a direct negative impact on the double-click event Multitouch operation that is not pinch-scaled in the same position on the page
for sites optimized for mobile devices, there is a slight visual impact due to the cancellation of a double-click event
However, all 2 of these questions can be set using Chrome's font size Settings tool. With the Android Magnifier, which is spread across apps and Web pages, Magnifier can be triggered with three taps.
Anyway, we may have overlooked some of the problems, assuming you were affected by this modification, please let us know by commenting or bill of lading.
Will other browsers do the same?
I don't know, but I hope they do the same.
Firefox has a bug list for this issue. 300MS latency has now been avoided on Web pages that cannot be scaled.
On the iOS Safari browser. On Web pages that cannot be scaled, Double-tap is a scrolling gesture.
Therefore, 300ms delay is also removed.
They don't want to get rid of it on a page that can be scaled.
Windows phone still retains 300ms latency on non-scalable web pages, but doesn't offer replacement gestures like iOS, so you can remove 300ms latency like chrome. You can use the following CSS to remove the delay
HTML { -ms-touch-action:manipulation; Touch-action:manipulation;}
unfortunately. This is an extension of Microsoft for pointer event standards. Developers can choose to use the code above to handle 300ms latency on the Windows Phone browser, and Chrome's changes can speed up all sites optimized for mobile devices.
same moment There are other ways to solve the problem ...
fastclick by FT Labs
fastclick will avoid setting up a listener, so You can enjoy the both worlds.
Mobile browser Chrome for Android remove 300ms Click Postpone