디바이스별 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 }?>
 
 
|

댓글 5개

좋네요 굿뜨!
오 좋네요. 이거 바로 써먹을수 있을것 같네요.
골머리 썩고 있었는데,
이 문서 때문에 힌트 얻어 작업 마무리가 잘 되었습니다.
감사합니다!!
감사합니다!!
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
13년 전 조회 1,693
13년 전 조회 1,146
13년 전 조회 2,863
13년 전 조회 1,866
13년 전 조회 1,011
13년 전 조회 1,250
13년 전 조회 7,832
13년 전 조회 2,746
13년 전 조회 1,326
13년 전 조회 1,674
13년 전 조회 3,270
13년 전 조회 1,420
13년 전 조회 2만
13년 전 조회 3,340
13년 전 조회 3,016
13년 전 조회 5,200
13년 전 조회 2,307
13년 전 조회 1,169
13년 전 조회 1,385
13년 전 조회 1.6만
13년 전 조회 1,131
13년 전 조회 2,558
13년 전 조회 2,100
13년 전 조회 1,638
13년 전 조회 1,523
13년 전 조회 1,651
13년 전 조회 2.4만
13년 전 조회 2,988
13년 전 조회 2.9만
13년 전 조회 2,569
13년 전 조회 2.3만
13년 전 조회 6,104
13년 전 조회 1,293
13년 전 조회 1,279
13년 전 조회 3,171
13년 전 조회 1,443
13년 전 조회 2,714
13년 전 조회 1,865
13년 전 조회 1,863
13년 전 조회 7,018
13년 전 조회 5,603
13년 전 조회 1,441
13년 전 조회 1,543
13년 전 조회 5,413
13년 전 조회 6,746
13년 전 조회 1,545
13년 전 조회 890
13년 전 조회 1,269
13년 전 조회 2,259
13년 전 조회 5,998
13년 전 조회 1,396
13년 전 조회 2,096
13년 전 조회 1,662
13년 전 조회 842
13년 전 조회 1,673
13년 전 조회 1,114
13년 전 조회 959
13년 전 조회 6,472
13년 전 조회 1,231
13년 전 조회 776
13년 전 조회 3,151
13년 전 조회 1,533
13년 전 조회 3,949
13년 전 조회 1,720
13년 전 조회 1,391
13년 전 조회 943
13년 전 조회 926
13년 전 조회 1,162
13년 전 조회 1,379
13년 전 조회 2,092
13년 전 조회 1,347
13년 전 조회 2,509
13년 전 조회 1,423
13년 전 조회 4,570
13년 전 조회 3,708
13년 전 조회 5,288
13년 전 조회 7,872
13년 전 조회 3,125
13년 전 조회 2,564
13년 전 조회 960
13년 전 조회 3,282
13년 전 조회 1,182
13년 전 조회 4,712
13년 전 조회 2,876
13년 전 조회 2,177
13년 전 조회 1,958
13년 전 조회 6,303
13년 전 조회 2,109
13년 전 조회 1,764
13년 전 조회 1,674
13년 전 조회 3,211
13년 전 조회 3,185
13년 전 조회 1,535
13년 전 조회 1,735
13년 전 조회 4,962
13년 전 조회 1,052
13년 전 조회 1,518
13년 전 조회 1,841
13년 전 조회 2,247
13년 전 조회 2,287