Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19360 댓글 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>
-
프로그램 문서 관리 (Doxygen)
-
프로그래밍에서 foo, bar 함수의 유래
-
프로그래밍 소스 관련 사이트..
-
페이팔에서 돈 찾기 (Paypal withdraw)
-
캘리포니아 운전면허 족보
-
최근 논문 자료 (2011/01/03, 만현형한테 보낸거..)
-
참고하고 지울 자료.. 집에서 바야지.. ㅋㅋ
-
정리할 자료.
-
자주 쓰는 Docker 명령어 alias
-
이어서 작업할 내용~
-
웹페이지 성능 테스트 툴 설명
-
알고리즘 성능분석