Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19431 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
565 | Develop | [iphone] view에 대한 조사 ㅡ,.ㅡ; | hooni | 2013.04.23 | 54119 |
564 | Develop | [iphone] performSelector:withObject:afterDelay: 에 대한 내용 | hooni | 2013.04.23 | 65905 |
563 | Develop | [iphone] PerfectlyClear 보정솔루션 최신.. | hooni | 2013.05.28 | 0 |
562 | Develop | [io] Apple Watch, Today Extension 앱ID 설정 | hooni | 2016.04.20 | 948 |
561 | Develop | [ios][swift] 초간단 카달로그 앱 (Catalog App) | hooni | 2016.06.27 | 7456 |
560 | Develop | [ios][swift] 초간단 To-do Memo | hooni | 2016.06.27 | 1195 |
559 | Develop | [ios][swift] 초간단 TableView 샘플 | hooni | 2016.06.27 | 875 |
558 | Develop | [ios] 한샘 카달로그 앱 소스 (아이폰용) | hooni | 2013.04.23 | 10922 |
557 | Develop | [ios] 푸시알림(APNS)에 대한 php 라이브러리 ㅋㅋ | hooni | 2013.04.23 | 16672 |
556 | Develop | [ios] 패스(path) 앱 메뉴 스타일 | hooni | 2013.06.11 | 0 |
555 | Develop | [ios] 테이블뷰셀/뷰에 배경 패턴 넣기.. | hooni | 2013.04.23 | 29859 |
554 | Develop | [ios] 코코아 프로그래밍의 네이밍 룰(명명 규칙) | hooni | 2017.05.11 | 1294 |