Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
조회 수 19410 댓글 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>
-
[php] 몽이가 준 ajax 채팅 소스 ㅋㅋ
-
[php] 메모장 - 웅지학원 ([c] mysql 백업프로그램 포함)
-
[php] 마시마로 캐릭터 방명록
-
[php] 데이터를 엑셀,워드 형태로 변환할 때 헤더(ms-office)
-
[php] 니우쪽지다.. 받아라~ ^^
-
[php] 논문 관리 프로그램.. ㅋㅋ
-
[php] 날짜 정보 출력 (년,월,일,시,분,초)
-
[php] 그래프 그리는 프로그램..
-
[php] XE에서 도메인 별로 광고 다르게 적용하기
-
[php] XE 에서 php 구문 사용하기 (XE 템플릿에서)
-
[php] XE 스킨에서 특정 도메인 리다이렉션
-
[php] XE 관리자 IP대역 설정 오류 해결법