Web应用程序中的iPhone加速度计 [英] iPhone accelerometer in web applications

查看:317
本文介绍了Web应用程序中的iPhone加速度计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的网站根据设备位置更改其布局。该网站有2种布局类型:垂直(高度>宽度)ang水平(宽度>高度)。

I want my website to change its layout according to the device positon. The site has 2 layout types: vertical(height > width) ang horizontal(width > height).

您看到任何解决方案吗?

do you see any solution?

upd :我没有看到更改网站布局的任何复杂性。我想知道是否有任何事件需要处理。
p.s.如果我将设备旋转90度,iphone的浏览器会改变它的方向吗?
Dave,tnx进行修正。

upd: I don't see any complexity in changing the site layout. I want to know is there any event to handle. p.s. will iphone's browser change its orientation if i rotate the device 90 degree? Dave, tnx for emendation.

推荐答案

有一个名为的onjientationchange 事件

参见文档了解更多信息和样本。

See the documentation for more info and sample.

这篇关于Web应用程序中的iPhone加速度计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆