MotorolaDroid1のWebkitで画面の回転を検出しようとしています。次のJavasCriptコードがあります。
var supportsOrientationChange = "onorientationchange" in window,
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize";
window.addEventListener(orientationEvent, function() {
alert("screen.width: " + screen.width + ", window.orientation: " + window.orientation);
}, false);
問題は、電話が縦向きに回転するとscreen.width 569に警告し、横向きに回転すると320に警告することです。これは私には意味がありません!誰かが明確にすることができますか?
ありがとう、イゴール