Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
Views 19429 Comment 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>
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
441 | Develop |
[js] 한글문서로 된 259가지 자바스크립트 예제파일
![]() |
hooni | 2013.04.23 | 6776 |
440 | System/OS | 나중에 해봐야지.. libconv 설치.. ㅡ,.ㅡ; | hooni | 2013.04.23 | 19336 |
439 | Develop | [js] 자바스크립트 escape()를 PHP로 받기 | hooni | 2013.04.23 | 6001 |
438 | Develop |
[php] 피코맥스용 검색엔진 ㅋㅋ
![]() |
hooni | 2013.04.23 | 6814 |
437 | Develop |
[c][java] 그래픽(graphic)관련 자료와 샘플코드..
![]() |
hooni | 2013.04.23 | 9216 |
436 | Develop |
[java] 그래픽(도형,다각형..) 이동,확대,축소,회전에 대한 내용..
1 ![]() |
hooni | 2013.04.23 | 8656 |
435 | Develop |
[doc] Equation Solving에 대한 발표자료..
![]() |
hooni | 2013.04.23 | 7993 |
434 | Develop |
[c] 베지어 곡선(Bézier curve) 알고리즘
![]() |
hooni | 2013.04.23 | 8567 |
433 | Develop |
[c] 플러드 필링 (flood filling) 알고리즘..
![]() |
hooni | 2013.04.23 | 7332 |
432 | Develop |
[c++] 헤더, 소스 파일 분리해서 작성해본 테스트 소스
![]() |
hooni | 2013.04.23 | 6717 |
431 | Develop |
[c] 더블(이중) 연결리스트 예제..
![]() |
hooni | 2013.04.23 | 7481 |
430 | Develop |
[c][java] 주사선 채우기 알고리즘(scan line filling algorithm) 구현
![]() |
hooni | 2013.04.23 | 8983 |