Search code examples
javascripthtmltouch

How can I detect if the browser supports the gesturestart event?


How can I detect if the browser supports the gesturestart and other gesture events? These events are used for pinch to rotate and zoom.

They seem to be only available on iOS.

I wish to emulate them if they are not available natively.


Solution

  • I think you can simply check if event exists, something like this:

    document.documentElement.ontouchstart !== 'undefined'