O'Reilly logo

HTML5 Canvas Cookbook by Eric Rowell

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

Attaching touch event listeners to regions on a mobile device

For those of you crying "What about mobile devices? Desktops and laptops are a thing of the past!" – this recipe is just for you. As Internet surfers migrate away from their giant tethered desktops and begin consuming Internet content from mobile devices, it's becoming more evident every day that the future of the Web, including canvas, will reside mostly in the mobile space.

Unlike web applications running on desktops and laptops, where user interactions are detected using the mouse from mousedown, mouseup, mouseover, mouseout, and mousemove events, web applications running on mobile devices are interacted with touch events from touchstart, touchend, and touchmove events.

In this recipe, ...

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