디바이스별 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,605
13년 전 조회 1,060
13년 전 조회 2,797
13년 전 조회 1,782
13년 전 조회 939
13년 전 조회 1,180
13년 전 조회 7,747
13년 전 조회 2,673
13년 전 조회 1,213
13년 전 조회 1,578
13년 전 조회 3,136
13년 전 조회 1,301
13년 전 조회 2만
13년 전 조회 3,217
13년 전 조회 2,928
13년 전 조회 5,088
13년 전 조회 2,221
13년 전 조회 1,093
13년 전 조회 1,269
13년 전 조회 1.6만
13년 전 조회 1,032
13년 전 조회 2,480
13년 전 조회 2,035
13년 전 조회 1,567
13년 전 조회 1,448
13년 전 조회 1,575
13년 전 조회 2.4만
13년 전 조회 2,896
13년 전 조회 2.9만
13년 전 조회 2,493
13년 전 조회 2.3만
13년 전 조회 6,025
13년 전 조회 1,217
13년 전 조회 1,202
13년 전 조회 3,092
13년 전 조회 1,362
13년 전 조회 2,594
13년 전 조회 1,796
13년 전 조회 1,785
13년 전 조회 6,924
13년 전 조회 5,488
13년 전 조회 1,347
13년 전 조회 1,475
13년 전 조회 5,330
13년 전 조회 6,680
13년 전 조회 1,464
13년 전 조회 804
13년 전 조회 1,187
13년 전 조회 2,151
13년 전 조회 5,890
13년 전 조회 1,319
13년 전 조회 1,985
13년 전 조회 1,586
13년 전 조회 765
13년 전 조회 1,583
13년 전 조회 1,045
13년 전 조회 890
13년 전 조회 6,396
13년 전 조회 1,154
13년 전 조회 705
13년 전 조회 3,058
13년 전 조회 1,446
13년 전 조회 3,821
13년 전 조회 1,643
13년 전 조회 1,320
13년 전 조회 863
13년 전 조회 847
13년 전 조회 1,088
13년 전 조회 1,293
13년 전 조회 2,000
13년 전 조회 1,284
13년 전 조회 2,414
13년 전 조회 1,346
13년 전 조회 4,476
13년 전 조회 3,624
13년 전 조회 5,211
13년 전 조회 7,799
13년 전 조회 3,048
13년 전 조회 2,484
13년 전 조회 885
13년 전 조회 3,210
13년 전 조회 1,101
13년 전 조회 4,619
13년 전 조회 2,744
13년 전 조회 2,101
13년 전 조회 1,882
13년 전 조회 6,224
13년 전 조회 2,021
13년 전 조회 1,685
13년 전 조회 1,590
13년 전 조회 3,125
13년 전 조회 3,109
13년 전 조회 1,447
13년 전 조회 1,657
13년 전 조회 4,894
13년 전 조회 961
13년 전 조회 1,432
13년 전 조회 1,746
13년 전 조회 2,153
13년 전 조회 2,176