Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19409 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
741 | Develop | [ios] iOS In App Purchase 코드 부분 샘플 2 | hooni | 2013.11.20 | 11317 |
740 | Develop | [switch] 시스코 스위치(catalyst 2950) telnet 설정 | hooni | 2013.04.23 | 11291 |
739 | Develop | [unix] 유닉스 명령에 메타문자 사용 | hooni | 2014.02.19 | 11289 |
738 | Develop | [c] 파일입출력 간단한 설명 | hooni | 2003.04.23 | 11261 |
737 | Etc | [NFC] 단말기와 서버 통신 내용 | hooni | 2013.11.12 | 11223 |
736 | System/OS |
[doc] TCP/IP 강의 자료 (html)
![]() |
hooni | 2013.04.23 | 11222 |
735 | System/OS | [linux] 시스템 데몬 종류와 설명 | hooni | 2013.04.23 | 11196 |
734 | Develop | [c] 최대공약수, 최소공배수, 서로소 구하기 (펌) | hooni | 2013.04.23 | 11189 |
733 | Develop |
[c] 파일입출력, 링크리스트(linked list)를 이용한 주소록(도스용) 소스코드
1 ![]() |
hooni | 2003.04.23 | 11170 |
732 | Develop |
[iphone] 파일 업로드 샘플 코드 ㅎㅎ
![]() |
hooni | 2013.04.23 | 11120 |
731 | Database | [mysql] 루트 암호 초기화 | hooni | 2013.04.23 | 11104 |
730 | Develop |
[c++] SetWindowPos함수를 이용한 크기조절 예제
1 ![]() |
hooni | 2013.04.23 | 11099 |