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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
841 | Develop | 프로그램 문서 관리 (Doxygen) | hooni | 2013.04.23 | 16438 |
840 | Develop | 프로그래밍에서 foo, bar 함수의 유래 | hooni | 2013.06.25 | 21475 |
839 | Develop | 프로그래밍 소스 관련 사이트.. | hooni | 2013.04.23 | 16526 |
838 | Develop | 페이팔에서 돈 찾기 (Paypal withdraw) | hooni | 2014.02.20 | 11481 |
837 | Develop | 캘리포니아 운전면허 족보 | hooni | 2017.06.12 | 890 |
836 | Develop | 최근 논문 자료 (2011/01/03, 만현형한테 보낸거..) | hooni | 2013.04.23 | 10366 |
835 | Develop | 참고하고 지울 자료.. 집에서 바야지.. ㅋㅋ | hooni | 2013.04.23 | 12176 |
834 | Develop | 정리할 자료. | hooni | 2015.07.02 | 824 |
833 | Develop | 자주 쓰는 Docker 명령어 alias | hooni | 2020.01.10 | 272114 |
832 | Develop | 이어서 작업할 내용~ | hooni | 2013.11.21 | 0 |
831 | Develop | 웹페이지 성능 테스트 툴 설명 | hooni | 2013.04.23 | 27522 |
830 | Develop | 알고리즘 성능분석 | hooni | 2014.06.24 | 3106 |