Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19429 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
993 | Develop | [c++] 소켓 프로그래밍 관련 링크.. (퍼올려고 올린거) | hooni | 2013.04.23 | 7064 |
992 | Develop | [c++] 쓰레드(Thread) 객체의 사용 | hooni | 2013.04.23 | 8609 |
991 | Develop | [c++] 압축프로그램(Lite Zip) 샘플 | hooni | 2013.04.23 | 8631 |
990 | Develop | [c++] 웹폼(webform)전송과 http 파일 업로드 샘플 | hooni | 2013.04.23 | 33114 |
989 | Develop | [c++] 윈도우 API 정복 예제 | hooni | 2013.04.23 | 7633 |
988 | Develop | [c++] 윈도우 프로세스뷰어 분석.. ㅋㅋ | hooni | 2013.04.23 | 8868 |
987 | Develop | [c++] 인라인 함수 설명과 예제.. | hooni | 2013.04.23 | 6670 |
986 | Develop | [c++] 인라인 함수에 대한 설명 | hooni | 2013.04.23 | 7129 |
985 | Develop | [c++] 자료구조(링크리스트,스택,큐)와 후위 표기 계산기 샘플 ㅋㅋ 4 | hooni | 2013.04.23 | 12355 |
984 | Develop | [c++] 중복실행 방지(Mutex;뮤텍스 ) 샘플 소스.. ㅋㅋ | hooni | 2013.04.23 | 8767 |
983 | Develop | [c++] 채팅로봇 소스.. ㅋㄷㅋㄷ | hooni | 2013.04.23 | 8902 |
982 | Develop | [c++] 초간단 스택 두 가지 방식(class, struct) | hooni | 2013.04.23 | 7635 |