Boo*_*aka 7 iphone webkit rotation orientation ipad
我在这个问题上看到了类似的问题,但它们与本机应用程序有关.我为浏览器(Safari)中运行的iPhone/iPad构建了Web应用程序.
我想知道是否有办法防止浏览器中的方向改变,也许是通过一些元标记.我知道视口元标记,它允许您指定缩放和缩放功能,因此可能会有类似的方向.
我怀疑这是可能的,但我想我只是在这里提出一个问题.
是的,你可以.
使用Javascript:
/*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode*/
window.onorientationchange = function() {
var orientation = window.orientation;
switch(orientation) {
case 0:
//Portrait mode
case 90:
// Landscape left
case -90:
//Landscape right
}
Run Code Online (Sandbox Code Playgroud)
它写在iPhone文档的某个地方,但我找不到它:).
更新
来自iPhone文档
| 归档时间: |
|
| 查看次数: |
10307 次 |
| 最近记录: |