디바이스별 viewport 설정.
<?php if(strpos($_SERVER['HTTP_USER_AGENT'],"iPhone")){?>
<meta name="viewport" content="width=device-width, initial-scale=0.67, maximum-scale=0.67, minimum-scale=0.67, user-scalable=no, target-densitydpi=medium-dpi" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"iPad")){?>
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"Android 2")){?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes, target-densitydpi=device-dpi" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"Android")){?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=yes, target-densitydpi=device-dpi" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"Opera Mini")){?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"Opera 9")){?>
<meta name="viewport" content="initial-scale=0.75, maximum-scale=0.75, minimum-scale=0.75, user-scalable=no" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")){?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<?php }else if(strpos($_SERVER['HTTP_USER_AGENT'],"FROYO")){?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />
<?php }?>
'Web > HTML' 카테고리의 다른 글
[ie7 버그] 링크영역이 제대로 잡히지 않는 문제 (0) | 2014.03.07 |
---|---|
ie7 이하 버전에서의 z-index 버그 (0) | 2013.11.13 |
HTML5앱 viewport 공통설정 mj.viewport.js 라이브러리 (0) | 2013.04.09 |
레이어팝업 (0) | 2013.04.02 |
이미지 썸네일 사용시 롤오버 테두리 만들기 (0) | 2012.11.20 |