Chapter 11. Pinching and Other Complex Gestures

Support for multiple touches was one of the “wow” demos Steve Jobs gave when he introduced the iPhone. It’s still a pretty cool feature, and it makes touch devices a lot more fun to use.

Handling multi-touch gestures isn’t simple. Getting it right requires math and a solid understanding of asynchronous programming in JavaScript. But when you need it, you need it.

In this chapter we’ll cover the basics of handling multiple touches in WebKit, Firefox, and Internet Explorer 10. And you’ll learn how to implement pinch to zoom, the multi-touch gesture you’re most likely to need.

Understanding multi-touch limitations and support

Here’s the bad news first: Android 2.3 and below support only one touch in ...

Get Building Touch Interfaces with HTML5: Develop and Design Speed up your site and create amazing user experiences now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.