Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19357 댓글 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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
289 | Develop | [c] 서비스 거부 공격(DoS;Denial of Service) 간단 소스.. ㅋㅋ | hooni | 2013.04.23 | 6713 |
288 | Develop | [c] 분수계산 함수^^ | hooni | 2003.04.23 | 10055 |
287 | Develop | [c] 베지어 곡선(Bézier curve) 알고리즘 | hooni | 2013.04.23 | 8557 |
286 | Develop | [c] 베이지언(Bayesian) 패턴인식 과제 ㅋㅋ | hooni | 2013.04.23 | 7094 |
285 | Develop | [c] 반올림 함수!! ㅋㅋ | hooni | 2003.04.23 | 8084 |
284 | Develop | [c] 바로 보고 정리할 것.. ㅋㄷㅋㄷ | hooni | 2013.04.23 | 7133 |
283 | Develop | [c] 민수형 소스(도메인소켓포함) | hooni | 2013.04.23 | 6522 |
282 | Develop | [c] 민수형 libipq 샘플 소스 ㅋㅋ | hooni | 2003.04.23 | 14112 |
281 | Develop | [c] 문자열 컨트롤 함수로 만든 프로그램들.. | hooni | 2003.04.23 | 6786 |
280 | Develop | [c] 문자열 치환해주는 str_replace() 함수 | hooni | 2013.04.23 | 7385 |
279 | Develop | [c] 문자열 처리(문자열 자르기) | hooni | 2003.04.23 | 8637 |
278 | Develop | [c] 문자열 처리 관련 함수들 설명 | hooni | 2003.04.23 | 7997 |