Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19366 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
» | Develop | [js]모바일 웹에서 orientationchange | hooni | 2013.04.23 | 19366 |
992 | Etc | 정보시스템(정보보안)의 위험관리 설명 | hooni | 2013.04.23 | 19346 |
991 | System/OS | 나중에 해봐야지.. libconv 설치.. ㅡ,.ㅡ; | hooni | 2013.04.23 | 19290 |
990 | System/OS | [mysql] MySQL server has gone away 에러 대응 | hooni | 2013.05.29 | 19233 |
989 | Develop |
모터에 대한 pid 제어.. ㅎㅎ
![]() |
hooni | 2013.04.23 | 18884 |
988 | Develop |
URI 인코딩, URL 인코딩
![]() |
hooni | 2013.04.23 | 18855 |
987 | System/OS | [linux] APM(apache, php, mysql) + gd 설치순서.. | hooni | 2003.04.23 | 18854 |
986 | System/OS | [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리 | hooni | 2013.07.10 | 18805 |
985 | System/OS | [linux] 패킷의 소스 주소 바꾸기 | hooni | 2003.04.23 | 18797 |
984 | Develop |
[ios] Objective-C에서 형식이 있는 문자열(Format Strings)에 사용할 수 있는 토큰들(Tokens)
![]() |
hooni | 2013.04.23 | 18790 |
983 | Develop |
[ios] libxml/tree.h file not found
![]() |
hooni | 2013.08.08 | 18716 |
982 | Database | [mysql] 접속과 테이블 생성 간단한 설명.. | hooni | 2003.04.23 | 18661 |