Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19419 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
189 | Develop | [ios] NSData to NSString (NSString to NSData) | hooni | 2015.07.21 | 719 |
188 | System/OS | 맥 OS X 에서 스크린 화면 캡쳐 단축키 (Mac Print Screen) | hooni | 2015.07.21 | 2024 |
187 | Develop |
[ios] AES256 알고리즘을 이용해 데이터 암호화/복호화 방법
![]() |
hooni | 2015.07.21 | 4178 |
186 | PPT |
[ppt] Equation Solving 발표 자료 (@AjaxUI랩 밋업데이 2012.02.28)
![]() |
hooni | 2015.07.22 | 985 |
185 | PPT |
[ppt] Information Security 발표 자료 (@Team Study 2012.11.15)
![]() |
hooni | 2015.07.22 | 953 |
184 | PPT |
[ppt] Macro for board game 발표자료 (@Team Study 2013.01.18)
1 ![]() |
hooni | 2015.07.22 | 1362 |
183 | Develop | [ios] Objective-C Types & Storage Capacity | hooni | 2015.07.22 | 1248 |
182 | Develop |
[ios] 오브젝티브C→스위프트, 코드 변환 손쉽게
![]() |
hooni | 2015.08.07 | 1065 |
181 | Develop | [git] 쉬운 버전관리 Git 설명 | hooni | 2015.08.18 | 944 |
180 | Database | [mysql] CPU 점유율이 높을 때 확인할 내용 | hooni | 2015.08.26 | 6748 |
179 | Develop |
[ios] SBCampanion App 초안
![]() |
hooni | 2015.09.16 | 754 |
178 | Develop | [ios] How to set up clang formatter | hooni | 2015.09.17 | 1461 |