Contents

Views 19429 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
<!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>  

?

List of Articles
No. Category Subject Author Date Views
441 Develop [js] 네이버에서 그림 퍼올 때.. URL Encoding 관련ㅋㅋ hooni 2013.04.23 7242
440 Develop [jsp] 초간단한 include 구문 예제.. file hooni 2013.04.23 7239
439 Develop [c] 문자열 라이브러리 최신버전 file hooni 2003.04.23 7220
438 Develop [c] 네트워크 관련 프로그래밍 (포트스캔 탐지 샘플) file hooni 2013.04.23 7214
437 Develop [c] 함수 목록과 예제 소스 파일 file hooni 2013.04.23 7207
436 Develop [c++] template 사용예 hooni 2003.04.23 7206
435 Develop [c] 시스템 보안 과제.. 시간(amc time) 변경 file hooni 2013.04.23 7203
434 Develop [php] 탐색기와 같은 다이나믹 트리(xml/xsl 이용) file hooni 2013.04.23 7200
433 Develop [c] 시스템공학 레포트 (pass1, pass2) file hooni 2003.04.23 7198
432 Develop [c] 가변인자 함수(printf와 같은..) hooni 2013.04.23 7197
431 Develop [c++] 트리컨트롤 예제1 ㅋㅋ file hooni 2013.04.23 7191
430 Develop [c] 연산자 우선순위.. ㅋㅋ hooni 2013.04.23 7190
Board Pagination Prev 1 ... 57 58 59 60 61 62 63 64 65 66 ... 98 Next
/ 98