6. (mouseenter) > mouseover > mousemove* >
mousedown > (focus) > mouseup > click
*only a single “sacrificial” event is fired
7. on first tap
(mouseenter) > mouseover > mousemove >
mousedown > (focus) > mouseup > click
subsequent taps
mousemove > mousedown > 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)
24. on first tap
touchstart > [touchmove]+ > touchend >
(mouseenter) > mouseover > mousemove > mousedown >
(focus) > mouseup > click
subsequent taps
touchstart > [touchmove]+ > touchend >
mousemove > mousedown > mouseup > click
tapping away
mouseout > (mouseleave) > (blur)
too many touchmove events abort the tap (after touchend)
too many touchmove events on activatable elements lead to touchcancel
not all browsers consistently send the touchmove
some browsers outright weird...
41. if ('ontouchstart' in window) {
/* some clever stuff here */
}
/* older browsers have flaky support
so more hacky tests needed...
use Modernizr.touch or similar */
42. /* common performance “trick” */
var clickEvent = ('ontouchstart' in window ?
'touchend' : 'click');
blah.addEventListener(clickEvent,
function() { ... }, false);
69. Chrome 32 for Android removes delay also when
<meta name="viewport" content="width=device-width">
updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away
109. /* iOS/Safari has gesture events for size/rotation,
not supported in Chrome/Firefox/Opera,
not part of the W3C Touch Events spec. */
gesturestart, gesturechange, gestureend
e.scale, e.rotation
110. /* with some trigonometry we can replicate these
from basic principles. */
var distance = Math.sqrt(Math.pow(...)+Math.pow(...));
var angle = Math.atan2(...);
143. you can preventDefault()
most mouse compatibility events on pointerdown
...but click is not considered mouse compatibility event,
and the 300ms delay is not affected by this.
151. /* PointerEvents don't have the handy touch arrays,
so we have to replicate something similar... */
152. /* PointerEvents don't have the handy touch arrays,
so we have to replicate something similar... */
var points = [];
switch (e.type) {
case 'pointerdown':
/* add to the array */
break;
case 'pointermove':
/* update the relevant array entry's x and y */
break;
case 'pointerup':
/* remove the relevant array entry */
break;
}
154. /* 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? */
171. Matt Gaunt – Touch Feedback for Mobile Sites
www.gauntface.co.uk/blog/2013/06/25/touch-feedback-for-mobile-sites
Jonathan Stark – FastActive
github.com/jonathanstark/FastActive
Stephen Woods – HTML5 Touch Interfaces
www.slideshare.net/ysaw/html5-touch-interfaces-sxsw-extended-version
David Rousset – Unifying touch and mouse: how Pointer Events will make cross-browsers touch support easy
blogs.msdn.com/b/davrous/archive/2013/02/20/handling-touch[...]
Chris Wilson + Paul Kinlan – Touch And Mouse: Together Again For The First Time
www.html5rocks.com/en/mobile/touchandmouse
Patrick H. Lauke – Webseiten zum Anfassen
webkrauts.de/artikel/2012/einfuehrung-touch-events
Ryan Fioravanti – Creating Fast Buttons for Mobile Web Applications
developers.google.com/mobile/articles/fast_buttons
Boris Smus – Multi-touch Web Development
www.html5rocks.com/en/mobile/touch
Boris Smus – Generalized input on the cross-device web
smus.com/mouse-touch-pointer
172. Rick Byers + Boris Smus (Google I/O) – Point, Click, Tap, Touch - Building Multi-Device Web Interfaces
developers.google.com/events/io/sessions/361772634
Grant Goodale – Touch Events
www.w3.org/conf/2011/#Touch_Events
W3C – Touch Events Extensions
www.w3.org/TR/2013/NOTE-touch-events-extensions-20131031
Mozilla Developer Network – Touch Events
developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Events/Touch_events
WebPlatform.org – Pointer Events
docs.webplatform.org/wiki/concepts/Pointer_Events
Rick Byers – The best way to avoid the dreaded 300ms click delay is to disable double-tap zoom
plus.google.com/+RickByers/posts/ej7nsuoaaDa
Tim Kadlec – Avoiding the 300ms Click Delay, Accessibly
timkadlec.com/2013/11/Avoiding-the-300ms-click-delay-accessibly
Microsoft – Pointer events updates (differences between IE10 and IE11)
msdn.microsoft.com/en-us/library/ie/dn304886(v=vs.85).aspx
173. Patrick H. Lauke – Webseiten zum Anfassen
webkrauts.de/artikel/2012/einfuehrung-touch-events
Patrick H. Lauke – Drei unter einem Dach: Pointer-Events für Maus, Stylus und Touchscreen
webkrauts.de/artikel/2013/drei-unter-einem-dach
Tilo Mitra – The State of Gestures
speakerdeck.com/tilomitra/the-state-of-gestures
Microsoft – Hover touch support (IE10/IE11)
msdn.microsoft.com/en-us/library/ie/dn265029(v=vs.85).aspx
Stu Cox – The Golden Pattern for Handling Touch Input
www.stucox.com/blog/the-golden-pattern-for-handling-touch-input/
Peter-Paul Koch – Touch table
www.quirksmode.org/mobile/tableTouch.html
Peter-Paul Koch – Preventing the touch default
www.quirksmode.org/mobile/default.html
Peter-Paul Koch – Mouse event bubbling in iOS
www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html