<html>
<head>
function checkOrientation() {
var orientation = window.orientation;
alert(orientation);
switch(orientation) {
case 0:
//Portrait mode - switch to -90
document.getElementsByTagName("body")[0].style.webkitTransform = "rotate(-90deg)";
break;
case 90:
document.getElementsByTagName("body")[0].style.webkitTransform = "rotate(-180deg)";
break;
}
}
window.onorientationchange = checkOrientation;
checkOrientation();
</head>
<body>
This is the body.
</body>
</html>