【发布时间】:2012-02-24 22:29:42
【问题描述】:
任何人都可以告诉如何在移动 web 应用程序的横向锁定 ipad 方向。即使它翻转它也不应该旋转成纵向。
function reorient(e) {
var portrait = (window.orientation % 180 != 0);
$("body").css("-webkit-transform", !portrait ? "rotate(90deg)" : "");
alert("hi");
}
window.onorientationchange = reorient;
window.setTimeout(reorient, 0)
我尝试了这些代码,但它只影响设计。在我的情况下它应该翻转
【问题讨论】: