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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
429 | System/OS | [linux] vi 편집기 간단한 명령과 환경설정 | hooni | 2003.04.23 | 11408 |
428 | Develop | [spring] 스프링 IoC/DI | hooni | 2013.04.23 | 11408 |
427 | System/OS | [linux] iptables 명령어 매뉴얼(options) | hooni | 2003.04.23 | 11410 |
426 | Develop | [switch] 시스코 카탈리스트(Cisco Catalyst) 2950 미러링 설정 | hooni | 2013.04.23 | 11431 |
425 | Develop |
[c++] mfc 조건별 파일 검색 프로그램 소스 ㅋㅋ
19 ![]() |
hooni | 2013.04.23 | 11437 |
424 | Develop | [ios] UIButton multi-line iOS7 | hooni | 2014.01.09 | 11463 |
423 | System/OS |
[linux] GD 라이브러리 설치 방법..
![]() |
hooni | 2013.04.23 | 11471 |
422 | Develop | [c++] 기초강좌 #01(입출력,영역지정) | hooni | 2003.04.23 | 11473 |
421 | Develop |
페이팔에서 돈 찾기 (Paypal withdraw)
![]() |
hooni | 2014.02.20 | 11480 |
420 | Develop | [c++] 기초강좌 #02(레퍼런스,메모리할당) | hooni | 2003.04.23 | 11482 |
419 | Develop | [c++] mfc 이용한 기본적인 형변환 예제 | hooni | 2013.04.23 | 11502 |
418 | Develop |
[c] 테트리스(Tetris) 게임(도스용) 소스코드
![]() |
hooni | 2003.04.23 | 11522 |