5

I've done some searching around and haven't found any good references for non-touch events provided to mobile browsers. Does anyone know of any good resources for what tilt events are supported or have experience with such things?

I'm really looking forward to adding some yaw controls.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Daniel X Moore
  • 14,637
  • 17
  • 80
  • 92

2 Answers2

10

You are looking for HTML5 DeviceOrientation and DeviceMotion events. Most modern smartphone browsers support these events now.

You might find useful information here: https://mobiforge.com/design-development/html5-mobile-web-device-orientation-events

Ariful Islam
  • 970
  • 8
  • 16
3

[edited]

Unfortunately at this time, without running as a native app, events from the accelerometer are not available.

Documentation for: Supported Events for Safari on iOS

If you want these events, consider going for a native app, and checkout Phonegap - it has what you are looking for, supported by both iOS and Adroid, plus considerably more.

Here's a quick link: to get up'n the API docs

defbyte
  • 611
  • 6
  • 14