디바이스별 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,710
13년 전 조회 1,167
13년 전 조회 2,894
13년 전 조회 1,887
13년 전 조회 1,036
13년 전 조회 1,273
13년 전 조회 7,855
13년 전 조회 2,769
13년 전 조회 1,363
13년 전 조회 1,695
13년 전 조회 3,297
13년 전 조회 1,449
13년 전 조회 2만
13년 전 조회 3,364
13년 전 조회 3,040
13년 전 조회 5,227
13년 전 조회 2,334
13년 전 조회 1,194
13년 전 조회 1,411
13년 전 조회 1.6만
13년 전 조회 1,144
13년 전 조회 2,581
13년 전 조회 2,124
13년 전 조회 1,656
13년 전 조회 1,541
13년 전 조회 1,676
13년 전 조회 2.4만
13년 전 조회 3,014
13년 전 조회 2.9만
13년 전 조회 2,595
13년 전 조회 2.3만
13년 전 조회 6,126
13년 전 조회 1,311
13년 전 조회 1,302
13년 전 조회 3,188
13년 전 조회 1,455
13년 전 조회 2,739
13년 전 조회 1,883
13년 전 조회 1,892
13년 전 조회 7,035
13년 전 조회 5,626
13년 전 조회 1,460
13년 전 조회 1,567
13년 전 조회 5,429
13년 전 조회 6,767
13년 전 조회 1,566
13년 전 조회 920
13년 전 조회 1,289
13년 전 조회 2,286
13년 전 조회 6,021
13년 전 조회 1,425
13년 전 조회 2,117
13년 전 조회 1,691
13년 전 조회 856
13년 전 조회 1,692
13년 전 조회 1,138
13년 전 조회 982
13년 전 조회 6,491
13년 전 조회 1,256
13년 전 조회 800
13년 전 조회 3,167
13년 전 조회 1,557
13년 전 조회 3,981
13년 전 조회 1,745
13년 전 조회 1,414
13년 전 조회 962
13년 전 조회 935
13년 전 조회 1,180
13년 전 조회 1,396
13년 전 조회 2,109
13년 전 조회 1,365
13년 전 조회 2,526
13년 전 조회 1,446
13년 전 조회 4,587
13년 전 조회 3,733
13년 전 조회 5,312
13년 전 조회 7,884
13년 전 조회 3,150
13년 전 조회 2,580
13년 전 조회 978
13년 전 조회 3,302
13년 전 조회 1,202
13년 전 조회 4,729
13년 전 조회 2,905
13년 전 조회 2,194
13년 전 조회 1,981
13년 전 조회 6,319
13년 전 조회 2,134
13년 전 조회 1,773
13년 전 조회 1,687
13년 전 조회 3,239
13년 전 조회 3,204
13년 전 조회 1,548
13년 전 조회 1,756
13년 전 조회 4,985
13년 전 조회 1,063
13년 전 조회 1,541
13년 전 조회 1,866
13년 전 조회 2,275
13년 전 조회 2,312