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>
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
741 | Develop | [c] 시스템공학 레포트 (pass1, pass2) | hooni | 2003.04.23 | 7203 |
740 | Develop | [php] 탐색기와 같은 다이나믹 트리(xml/xsl 이용) | hooni | 2013.04.23 | 7203 |
739 | Develop | [c] 시스템 보안 과제.. 시간(amc time) 변경 | hooni | 2013.04.23 | 7204 |
738 | Develop | [c++] template 사용예 | hooni | 2003.04.23 | 7206 |
737 | Develop | [c] 함수 목록과 예제 소스 파일 | hooni | 2013.04.23 | 7211 |
736 | Develop | [c] 네트워크 관련 프로그래밍 (포트스캔 탐지 샘플) | hooni | 2013.04.23 | 7218 |
735 | Develop | [c] 문자열 라이브러리 최신버전 | hooni | 2003.04.23 | 7222 |
734 | Develop | [jsp] 초간단한 include 구문 예제.. | hooni | 2013.04.23 | 7245 |
733 | Develop | [js] 네이버에서 그림 퍼올 때.. URL Encoding 관련ㅋㅋ | hooni | 2013.04.23 | 7246 |
732 | Develop | [c] 심심해서.. fseek() 예제.. | hooni | 2003.04.23 | 7254 |
731 | Develop | [html] 메타태그 사용예.. 은지나 바라~ | hooni | 2003.04.23 | 7255 |
730 | Develop | [c] 단기과정[01/17] 후위연산 스택 계산기.. | hooni | 2003.04.23 | 7255 |