O'Reilly logo

Instant Website Touch Integration by Alexander Dickson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to get tapping (Simple)

The cornerstone of touch events is the tap, which was first available to JavaScript via events courtesy of Apple's iPhone in 2007. At the time of writing, the W3C had formalized these events and it's finally in Proposed Recommendation status.

We'll take a look at the type of touch events and the data available with each one. With this knowledge, you can begin handling users' touch events.

Getting ready

You will need to open your editor, Google Chrome (so you can use emulated touch events) and preferably a touch-enabled device to do your final testing on. Set up your test environment as explained in the previous recipe.

How to do it…

  1. Determine if the user's device supports touch events.
  2. Find out which touch events are available ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required