Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19355 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
733 | Develop | [c++] mfc로 만든 현재 디렉토리 읽어오기/세팅하기 (GetCurrentDirectory/SetCurrentDirectory) | hooni | 2013.04.23 | 8448 |
732 | Develop | [c++] mfc에서 윈도우 항상 위 속성 주기.. | hooni | 2013.04.23 | 11287 |
731 | Develop | [c++] mfc이용한 트레이아이콘(TrayIcon) 클래스 예제 프로젝트 | hooni | 2013.04.23 | 9243 |
730 | Develop | [c++] namespace 사용 예 | hooni | 2003.04.23 | 8654 |
729 | Develop | [c++] p.118 확인학습 5번 | hooni | 2003.04.23 | 10734 |
728 | Develop | [c++] p.47 연습문제 3번 | hooni | 2003.04.23 | 10105 |
727 | Develop | [c++] p.58 연습문제 2번 | hooni | 2003.04.23 | 16296 |
726 | Develop | [c++] RSA Sample 4 CPP | hooni | 2013.04.23 | 9181 |
725 | Develop | [c++] SetWindowPos함수를 이용한 크기조절 예제 1 | hooni | 2013.04.23 | 11073 |
724 | Develop | [c++] String Tokenizer (나중에 c 코드로 변경해서 사용할 것) | hooni | 2013.04.23 | 11688 |
723 | Develop | [c++] template 사용예 | hooni | 2003.04.23 | 7147 |
722 | Develop | [c++] Win32 API 기본 출력인 MessageBox() 함수 사용 예제.. | hooni | 2013.04.23 | 12613 |