Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19430 댓글 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 | OpenGL 강좌 사이트 모음 | hooni | 2013.04.23 | 9672 |
564 | Develop |
[c] 오목.. 간단한 소스 ㅋㅋ
![]() |
hooni | 2013.04.23 | 9671 |
563 | Develop |
[c] 이진트리(binary tree)의 특성
![]() |
hooni | 2003.04.23 | 9639 |
562 | Develop | [js] Closure를 이용해 캡슐화.. | hooni | 2013.12.16 | 9620 |
561 | Develop |
[c++] 링크리스트(linked list) 클래스(스택,큐)
![]() |
hooni | 2003.04.23 | 9595 |
560 | Develop |
[c++] 마방진 소스코드
![]() |
hooni | 2013.04.23 | 9570 |
559 | Develop | [c] 파일(File)의 연결과 연결 해제 (link, unlink, chown) | hooni | 2013.04.23 | 9556 |
558 | Develop | [c] 팩토리얼.. - 재귀함수 | hooni | 2003.04.23 | 9529 |
557 | Develop |
[java] 거스름돈 계산.. swing 사용
![]() |
hooni | 2013.04.23 | 9464 |
556 | Develop |
[java] 스윙(swing)버튼 테스트 ㅋㅋ
![]() |
hooni | 2013.04.23 | 9448 |
555 | Develop | [js] jQuery 셀랙터(selector) 요약 | hooni | 2013.12.17 | 9439 |
554 | Develop |
[c] 공용체를 이용해 MSB를 LSB로 변환
![]() |
hooni | 2013.04.23 | 9390 |