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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
417 | Develop | [c] 학생명단 관리 프로그램 소스 ㅋㅋ 1 | hooni | 2003.04.23 | 7773 |
416 | Develop | [c] 학교 건물 최단거리 찾는 웹 연동 프로그램 | hooni | 2013.04.23 | 6800 |
415 | Develop | [c] 하노이탑 - 재귀함수 | hooni | 2003.04.23 | 9155 |
414 | Develop | [c] 플러드 필링 (flood filling) 알고리즘.. | hooni | 2013.04.23 | 7319 |
413 | Develop | [c] 프로세스간의 통신(파이프) | hooni | 2003.04.23 | 6891 |
412 | Develop | [c] 프로세스 정보 출력하기.. | hooni | 2003.04.23 | 6910 |
411 | Develop | [c] 프로세스 검사하기 | hooni | 2013.04.23 | 8028 |
410 | Develop | [c] 프로그램 코드(c/c++)를 html 파일로 변환 | hooni | 2013.04.23 | 7679 |
409 | Develop | [c] 프로그래밍의 전반적인 설명 ppt | hooni | 2003.04.23 | 7677 |
408 | Develop | [c] 프로그래밍 과제..(colprint) | hooni | 2003.04.23 | 6745 |
407 | Develop | [c] 프로그래밍 ppt, 스킬업 (비트 수업자료) | hooni | 2003.04.23 | 8179 |
406 | Develop | [c] 포인터와 함수포인터에 대해.. | hooni | 2003.04.23 | 8019 |