Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19360 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
609 | Develop | [iOS] Xcode 불필요한 캐시 삭제하기 | hooni | 2021.10.12 | 1810 |
608 | Develop | [ios] Xcode를 사용해서 Static Library 만들기 (시뮬레이터 + 디바이스) | hooni | 2015.01.03 | 3288 |
607 | Develop | [ios] XCode에서 Provisioning Profile 여러개 중복될 때 | hooni | 2014.06.26 | 2827 |
606 | Develop | [ios] Xcode에서 특정 파일만 ARC 따로 설정하는 방법 | hooni | 2017.03.29 | 956 |
605 | Develop | [ios] Xcode의 디버그 모드에서 콜스택 | hooni | 2015.01.03 | 1006 |
604 | Develop | [ios] 간단한 방법으로 OS버전 확인하기. | hooni | 2013.09.24 | 13318 |
603 | Develop | [ios] 개발 기초 가이드 링크.. | hooni | 2013.04.23 | 31370 |
602 | Develop | [ios] 구분자로 문자열 자르기 (split) | hooni | 2013.04.23 | 26273 |
601 | Develop | [ios] 기본 네비게이션바의 타이틀, back버튼 위치와 속성 변경 | hooni | 2016.05.16 | 2097 |
600 | Develop | [ios] 네트워크 인디케이터(NetworkActivityIndicator) 작동 | hooni | 2014.01.24 | 12493 |
599 | Develop | [ios] 동영상 플레이어 샘플 (for Local File) | hooni | 2017.02.07 | 1079 |
598 | Develop | [ios] 동영상 플레이어 샘플 (for PIP Player) | hooni | 2017.03.15 | 1272 |