Views 19357 Votes 0 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
105 Develop [ios] ViewController Push할 때 애니메이션 효과 hooni 2015.10.23 870
104 Develop [ios] NavigationController 에서 왼쪽(back) 버튼 후킹하기 hooni 2015.10.23 1180
103 Develop [c] 한글 문자열 출력 hooni 2015.11.10 1675
102 Develop [php] 한글 문자열 자르기 (utf-8) hooni 2015.11.10 1317
101 Develop [js] AngularJS 란? file hooni 2015.11.26 885
100 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C) file hooni 2016.03.23 1608
99 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Swift) file hooni 2016.03.23 7323
98 Develop [ios] Did UIScrollView End Scrolling? hooni 2016.04.19 1017
97 Develop [io] Apple Watch, Today Extension 앱ID 설정 hooni 2016.04.20 792
96 Develop XE Core 1.8.18 본문 작성시 태그(html) 사라지는 버그 file hooni 2016.04.21 864
95 Develop [c#] 전자금융보안론 발표/설치 자료(툴바 소스코드) secret hooni 2016.05.07 0
94 Develop [ios] UUID 생성 + Key Chain 연동 file hooni 2016.05.13 4661
93 Develop [ios] 기본 네비게이션바의 타이틀, back버튼 위치와 속성 변경 file hooni 2016.05.16 2085
92 Develop [ios] 웹뷰 history.back() ㅋㄷ file hooni 2016.06.27 1899
91 Develop [ios][swift] 초간단 TableView 샘플 file hooni 2016.06.27 734
90 Develop [ios][swift] 초간단 To-do Memo file hooni 2016.06.27 1063
Board Pagination Prev 1 ... 45 46 47 48 49 ... 53 Next
/ 53