开发者

Is it possible to receive tilt events in JavaScript on mobile Webkit for iOS or Android phones? [closed]

开发者 https://www.devze.com 2023-01-21 02:30 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_如何学运维

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

The community reviewed whether to reopen this question 1 year ago and left it closed:

Original close reason(s) were not resolved

Improve this question

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.


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

Here is a useful tutorial: http://www.html5rocks.com/en/tutorials/device/orientation/


[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

0

精彩评论

暂无评论...
验证码 换一张
取 消