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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
709 | Develop | [c++] 레지스트리 등록 예제 1 | hooni | 2013.04.23 | 8785 |
708 | Develop | [c++] 레지스트리 편집하는 부분..ㅡㅡ; | hooni | 2013.04.23 | 8271 |
707 | Develop | [c++] 링크리스트(linked list) 클래스(스택,큐) | hooni | 2003.04.23 | 9553 |
706 | Develop | [c++] 마방진 소스코드 | hooni | 2013.04.23 | 9558 |
705 | Develop | [c++] 문자열 뒤집기(문자열 거꾸로 출력) | hooni | 2013.04.23 | 17281 |
704 | Develop | [c++] 바탕화면 테두리에 자석처럼 붙는 스냅효과.. | hooni | 2013.04.23 | 8900 |
703 | Develop | [c++] 소켓 프로그래밍 관련 링크.. (퍼올려고 올린거) | hooni | 2013.04.23 | 7029 |
702 | Develop | [c++] 쓰레드(Thread) 객체의 사용 | hooni | 2013.04.23 | 8574 |
701 | Develop | [c++] 압축프로그램(Lite Zip) 샘플 | hooni | 2013.04.23 | 8603 |
700 | Develop | [c++] 웹폼(webform)전송과 http 파일 업로드 샘플 | hooni | 2013.04.23 | 33068 |
699 | Develop | [c++] 윈도우 API 정복 예제 | hooni | 2013.04.23 | 7608 |
698 | Develop | [c++] 윈도우 프로세스뷰어 분석.. ㅋㅋ | hooni | 2013.04.23 | 8834 |