Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19357 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
765 | Develop | [c] 프로그래밍의 전반적인 설명 ppt | hooni | 2003.04.23 | 7671 |
764 | Develop | [c] 프로그램 코드(c/c++)를 html 파일로 변환 | hooni | 2013.04.23 | 7677 |
763 | Develop | [c] 프로세스 검사하기 | hooni | 2013.04.23 | 8027 |
762 | Develop | [c] 프로세스 정보 출력하기.. | hooni | 2003.04.23 | 6906 |
761 | Develop | [c] 프로세스간의 통신(파이프) | hooni | 2003.04.23 | 6891 |
760 | Develop | [c] 플러드 필링 (flood filling) 알고리즘.. | hooni | 2013.04.23 | 7319 |
759 | Develop | [c] 하노이탑 - 재귀함수 | hooni | 2003.04.23 | 9153 |
758 | Develop | [c] 학교 건물 최단거리 찾는 웹 연동 프로그램 | hooni | 2013.04.23 | 6800 |
757 | Develop | [c] 학생명단 관리 프로그램 소스 ㅋㅋ 1 | hooni | 2003.04.23 | 7764 |
756 | Develop | [c] 한글 문자열 출력 | hooni | 2015.11.10 | 1678 |
755 | Develop | [c] 함수 목록과 예제 소스 파일 | hooni | 2013.04.23 | 7191 |
754 | Develop | [c] 함수 요약 (검색해서 쓰세요..) | hooni | 2003.04.23 | 8795 |