Handle multitouch events in web application

You can add multitouch support to your web application using touch events. To do it you can check number of touch points (e.g. event.touches).
// code (main.js):
var obj = document.getElementById('id');

// detect 2 fingers tap
obj.addEventListener('touchstart', function(event) {
	if (event.touches.length == 2) {
		// handle 2 fingers tap
	}
}, false);

Responses

0 Replies