This document provides an introduction to touch events for websites. It discusses how browsers emulate mouse events on touch devices and the limitations of this approach. Native touch events like touchstart, touchmove, and touchend are introduced as alternatives. The document covers issues like delayed event dispatching and handling both mouse and touch. It also discusses more advanced topics like multitouch support, gestures, and debugging touch events. Overall, the document serves as a guide to making websites more responsive on touch-enabled devices.
6. mouseover > mousemove* > mousedown >
(focus) > mouseup > click
*only a single âsacrificialâ events is fired
7. on first tap
mouseover > mousemove > mousedown >
(focus) > mouseup > click
subsequent taps
mousemove > mousedown > (focus) >
mouseup > click
tapping away
mouseout > (blur)
focus/blur only on focusable elements in Opera Mobile and Firefox
mouseout not on iOS Safari and embedded WebView (e.g. iOS Chrome)
87. /* iOS/Safari has gesture events for size/rotation,
not supported in Chrome/Firefox/Opera,
not part of the W3C Touch Events spec.
With some trigonometry we can replicate these
from basic principles. */
var distance = Math.sqrt(Math.pow(...)+Math.pow(...));
var angle = Math.atan2(...);
101. /* like iOS/Safari, IE10/Win has higher-level gestures,
but these are not part of the W3C Pointer Events spec.
Replicate these from basic principles again? */