Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Mobblestouch — W3C Touch Events and gestures
Search
Kornel Lesiński
October 25, 2011
Technology
770
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mobblestouch — W3C Touch Events and gestures
Presentation at Mr Mobbles Magical Emporium 10/2011
http://pornel.net/mobbles
Kornel Lesiński
October 25, 2011
More Decks by Kornel Lesiński
See All by Kornel Lesiński
SudWeb
kornel
0
280
Lossy PNG for true-color images (Velocity Conf EU 2014)
kornel
2
930
Modern PNG compressors
kornel
13
1.2k
Handling binary data in JS
kornel
1
430
Server-Sent Events
kornel
5
1k
"HTML5" Transport Protocol
kornel
3
440
Front-end Performance
kornel
5
540
Other Decks in Technology
See All in Technology
Datadog の学び方 - あるいは、オブザーバビリティを学ぶとは何か
mananyuki
1
530
スキルを作る、その前に!複数人で使われるスキルを 作るためのプロセス
junkifurukawa
2
370
初対面のメンバーがチームを組み、Claude Codeでゼロからサービスをリリース
mkdev10
1
120
継続的なAIコスト最適化
bgpat
1
280
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
0
110
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
170
予測不能な実行エージェントを安全にサクッと試せるサンドボックス環境の話
sansantech
PRO
0
140
go-sqletch
moznion
0
130
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
280
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
330
生成AIを使って「人が」考える技術 ― AI時代の人機共想と実践ノウハウ|UNITT AC2026
ishiirikie
0
580
Incremental HTTP
kazuho
5
2.1k
Featured
See All Featured
Visualization
eitanlees
153
17k
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Docker and Python
trallard
47
4.2k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
320
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Mind Mapping
helmedeiros
1
400
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
My Coaching Mixtape
mlcsv
0
340
The untapped power of vector embeddings
frankvandijk
2
1.9k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
350
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Transcript
Mobblestouch
www.w3.org/TR/touch-events
Microsoft http://blogs.msdn.com/b/ie/archive/2011/10/19/ handling-multi-touch-and-mouse-input-in-all-browsers.aspx
mousedown = mousemove = mouseup = touchstart touchmove touchend
mouseover mouseout :hover
click
element.ontouchstart = function(event){…} element.addEventListener (‘touchstart’,…,…)
TouchEvent interface event.touches = […] event.chagedTouches = […]
TouchEvent interface event.pageX → event.touches[i].pageX event.target → event.touches[i].target event.targetTouches
Touch interface touch.pageY/touch.pageX touch.target touch.identifier
Div 1 Div 2 Div 3 mousedown mousemove mouseup
Div 1 Div 2 Div 3 touchstart touchmove touchend
Tap and… ontouchstart = function() { timer = setTimeout(hold, 1000)
} ontouchend = function() { clearTimeout(timer) if (!held) tap() } var timer; …hold!
Hold on! ontouchstart = function(e) { if (e.touches.length > 1)
return; clearTimeout(timer) timer = setTimeout(hold, 1000) e.preventDefault() }
call event.preventDefault()
body.ontouchmove = function(e) {e.preventDefault()}
:active trick body.ontouchmove = function(){}
gesturestart gestureend
1 2 Math.sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) )
Zoom moves!
Math.atan2( (x-x),(y-y) )
Math.TAU = 2*Math.PI Math.atan2(…)/Math.TAU*360+180
Beware of CSS transforms order!
Swipe Slow = peek Fast = switch
Swipe event.timestamp
Device ✌ ✌ 2.x ” 3.x ✌ ? Emulator ✌
” ” None
Alt Alt + Shift
Phantom limb vodori.com/blog/phantom-limb.html
@media all and (-moz-touch-enabled:1) {…} if (ontouchstart in window) {…}
document.body.ontouchstart = function() { touch_enabled = true; } Detection
Trackpad ≠ Multitouch MozSwipeGesture XUL only MozMousePixelScroll onscroll event.wheelDeltaX/Y
@pornelski Image credits: Flickr—Vectorportal http://www.flickr.com/photos/ vectorportal, Flickr—Peter Kaminski http://flickr.com/people/peterkaminski, Denis-Carl
http://www.deniscarl.com, Failblog.com and Dailysquee.com. Presented at: Mr Mobbles Magical Emporium 10/2011