Develop
2013.04.23 18:11
[js]모바일 웹에서 orientationchange
Views 19357 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 |
---|---|---|---|---|---|
733 | Develop | [php] whois정보 조회 프로그램 | hooni | 2003.04.23 | 11733 |
732 | Develop | [php] URL/URI 관련 환경변수 | hooni | 2003.04.23 | 9146 |
731 | Develop | [php] substr() 한글 자를 때 깨짐 방지 | hooni | 2014.01.09 | 20363 |
730 | Develop | [php] php5.3부터는 eregi()대신 preg_match()를 사용 | hooni | 2013.11.18 | 12470 |
729 | Develop | [php] php+db 연동(odbc, mssql, mysql, sybase) 3 | hooni | 2013.04.23 | 8539 |
728 | Develop | [php] mysql_ 과 mysqli_ 의 차이 | hooni | 2017.12.01 | 1691 |
727 | Develop | [PHP] MacOS에서 PHP 7 설치하기 | hooni | 2018.05.11 | 4878 |
726 | Develop | [php] Laravel Route에서 PC/Mobile 분기 | hooni | 2018.01.24 | 2464 |
725 | Develop | [php] Laravel 5.4: Specified key was too long error | hooni | 2017.12.04 | 9221 |
724 | Develop | [php] Laravel 4. twitter bootstrap 적용하기 | hooni | 2018.04.05 | 2539 |
723 | Develop | [php] GregorianToJD(), JDToGregorian() 함수 내용 | hooni | 2013.12.25 | 10593 |
722 | Develop | [php] gd 프로그램.. htm 파일.. ㅋㅋ | hooni | 2013.04.23 | 7412 |