디바이스별 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 }?>
'Story > php' 카테고리의 다른 글
뱅크다 이용 무통장입금 처리 (0) | 2013.02.21 |
---|---|
window 에서 php fgetcsv 사용시 한글문제 (0) | 2012.12.10 |
exec 로 명령어 실행시 shell 에서는 동작하는 명령어가 php + apache 로는 동작하지 않는경우 (0) | 2012.05.01 |
php gd image crop 투명 배경 이미지 잘라내기 (0) | 2012.03.30 |
올더게이트 결제모듈 연동 (0) | 2012.03.22 |