Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19361 댓글 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 | [git] 쉬운 버전관리 Git 설명 | hooni | 2015.08.18 | 882 |
992 | Develop | [ios] 오브젝티브C→스위프트, 코드 변환 손쉽게 | hooni | 2015.08.07 | 968 |
991 | Develop | [ios] Objective-C Types & Storage Capacity | hooni | 2015.07.22 | 1163 |
990 | PPT | [ppt] Macro for board game 발표자료 (@Team Study 2013.01.18) 1 | hooni | 2015.07.22 | 1282 |
989 | PPT | [ppt] Information Security 발표 자료 (@Team Study 2012.11.15) | hooni | 2015.07.22 | 891 |
988 | PPT | [ppt] Equation Solving 발표 자료 (@AjaxUI랩 밋업데이 2012.02.28) | hooni | 2015.07.22 | 920 |
987 | Develop | [ios] AES256 알고리즘을 이용해 데이터 암호화/복호화 방법 | hooni | 2015.07.21 | 4112 |
986 | System/OS | 맥 OS X 에서 스크린 화면 캡쳐 단축키 (Mac Print Screen) | hooni | 2015.07.21 | 1912 |
985 | Develop | [ios] NSData to NSString (NSString to NSData) | hooni | 2015.07.21 | 644 |
984 | Develop | [ios] WWDC 2015 샘플 소스 코드 통합파일 | hooni | 2015.07.20 | 669 |
983 | Develop | [android] N-Puzzle 게임 | hooni | 2015.07.09 | 875 |
982 | System/OS | [windows] 윈도우 사용자 계정 로그인 암호 분실, 암호 변경하는 방법 | hooni | 2015.07.09 | 21384 |