Wednesday, October 19, 2011

Javascript Event Handling for Touchscreens

Ok guys (and gals) this one is shameless utilitarianism... I'm still hard at work on my last post, which is/will be by highly customizable version of the game Jeopardy, but as the mind bubbles are popping capillaries like popcorn all over my brain I wondered how different javascript/jquery events (like .click, .keyup, .mousemove, etc) might behave... on a touchscreen like my glorious android phone or fancier people's iTabletmajigers (to be announced in Nov).

So welcome to my playground...

Note: If you are looking at this on your computer, you can load this post up on your phone to play along by using this QR code. Just point your phone at it with Google Goggles, or some such other QR reader:

Clicking works as you'd expect, just tap and it hears you. Note that if you move your finger at all during a tap, the browser picks it up as panning the screen and the click listener at least gets nothing...
But mousemove only works in conjunction with an onclick-like interaction...
Yup, and key up works on input fields, which is cool!

No comments: