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>
-
[linux] 리눅스, 유닉스 CPU 이용률 확인..
-
[c] 다중연결 서버 만들기 #4 - thread 사용
-
[c#] 비동기 통신 샘플 코드 ㅎㅎ
-
[ppt] 뚜레쥬르 온라인 마케팅 제안서
-
GCM 사용하기 2 (단말에 GCM 구현하기)
-
[ios] 아이폰 개발 따라하기 ㅋㅋㅋ
-
러시아 페인트공 알고리즘에 대해..
-
[ios] UIColor 지정에서 RGB define ㅎㅎ
-
[js] 자바스크립트(Javascript) 코드를 동적으로 삽입하는 방법..
-
[ios] UILabel top alignㅎㅎ
-
[doc] 정보보호이론 강의자료 (중앙대꺼..)
-
밸런싱 로봇.. 최종.. (관련 논문도 첨부) ㅋㅋ