Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19432 댓글 0
<!DOCTYPE html>
<html>
<head>
<title>Orientation Checker</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximumscale=1.0; user-scalable=0;" />
<script type="text/javascript" src="/js/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
/*
* ios, android 둘다 지원되는 스크립트
*/
var ori_status;
$(document).ready(function() {
window.onorientationchange = changeOrientation;
window.setTimeout(changeOrientation, 0);
});
// event handler
function changeOrientation(){
if(ori_status == detectOrientation())return;
ori_status = detectOrientation();
alert(ori_status);
}
function detectOrientation(){
var orientation = window.orientation;
var rtn;
switch(orientation) {
case 90: case -90:
rtn = 'landscape';
break;
default:
rtn = 'portrait';
}
return rtn;
}
</script>
</head>
<body>
</body>
</html>
-
프로그래밍에서 foo, bar 함수의 유래
-
[ios] 패스(path) 앱 메뉴 스타일
-
[ios] 스터디 자료 (from 종길M)
-
[ios] IB 없이 개발하기 (html)
-
[iphone] PerfectlyClear 보정솔루션 최신..
-
[Android] 2010년에 만들었던 세미나 자료.
-
[js] 자바스크립트의 클로저 (JavaScript's Closure)
-
서기의 PHP 동영상 강의(싱싱해)
-
[js]모바일 웹에서 orientationchange
-
[android] keytool을 사용하여 키스토어 생성
-
[js] 모바일웹에서 이미지 저장하는거 (context menu) 막기
-
[js] JSON 컨트롤.. 재귀호출로 값 출력하기