1
我正在使用iPad中的方向。我正在使用電話差距來構建應用程序。 我已經做了以下的方向改變代碼:在javascript中使用iPad的方向
function updateOrientation()
{
var orientation=window.orientation;
if (orientation == 0) {
alert("Do Something In Portrait Mode");
}
else if (orientation == 90) {
alert("Do Something In landscape Mode");
}
else if (orientation == -90) {
alert("Do Something In Portrait Mode");
}
else if (orientation == 180) {
alert("Do Something In landscape Mode");
}
}
我收到警報,但我不知道如何來調整這裏面的窗口?我想要如下:
你有沒有考慮使用像jQuery Mobile的庫? :S它可以讓事情變得更容易我猜... – Littm
沒有,你可以請給一些更多的信息。] –
jQuery Mobile是一個javascript lib,它可以幫助你創建手機的網絡應用程序。它提供原生類組件,並具有根據設備的方向進行調整的特殊設計。你可以看看它:http://jquerymobile.com/ – Littm