디바이스별 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,782
13년 전 조회 1,249
13년 전 조회 2,971
13년 전 조회 1,967
13년 전 조회 1,105
13년 전 조회 1,353
13년 전 조회 7,921
13년 전 조회 2,837
13년 전 조회 1,435
13년 전 조회 1,764
13년 전 조회 3,376
13년 전 조회 1,518
13년 전 조회 2만
13년 전 조회 3,442
13년 전 조회 3,124
13년 전 조회 5,305
13년 전 조회 2,424
13년 전 조회 1,259
13년 전 조회 1,478
13년 전 조회 1.7만
13년 전 조회 1,207
13년 전 조회 2,651
13년 전 조회 2,205
13년 전 조회 1,728
13년 전 조회 1,606
13년 전 조회 1,751
13년 전 조회 2.4만
13년 전 조회 3,080
13년 전 조회 2.9만
13년 전 조회 2,665
13년 전 조회 2.3만
13년 전 조회 6,190
13년 전 조회 1,381
13년 전 조회 1,353
13년 전 조회 3,253
13년 전 조회 1,527
13년 전 조회 2,796
13년 전 조회 1,958
13년 전 조회 1,964
13년 전 조회 7,095
13년 전 조회 5,692
13년 전 조회 1,522
13년 전 조회 1,634
13년 전 조회 5,497
13년 전 조회 6,824
13년 전 조회 1,618
13년 전 조회 981
13년 전 조회 1,361
13년 전 조회 2,339
13년 전 조회 6,071
13년 전 조회 1,490
13년 전 조회 2,174
13년 전 조회 1,763
13년 전 조회 914
13년 전 조회 1,742
13년 전 조회 1,199
13년 전 조회 1,035
13년 전 조회 6,556
13년 전 조회 1,306
13년 전 조회 854
13년 전 조회 3,225
13년 전 조회 1,620
13년 전 조회 4,021
13년 전 조회 1,798
13년 전 조회 1,471
13년 전 조회 1,014
13년 전 조회 978
13년 전 조회 1,240
13년 전 조회 1,447
13년 전 조회 2,158
13년 전 조회 1,412
13년 전 조회 2,594
13년 전 조회 1,497
13년 전 조회 4,635
13년 전 조회 3,787
13년 전 조회 5,361
13년 전 조회 7,950
13년 전 조회 3,199
13년 전 조회 2,641
13년 전 조회 1,015
13년 전 조회 3,350
13년 전 조회 1,251
13년 전 조회 4,787
13년 전 조회 2,959
13년 전 조회 2,243
13년 전 조회 2,038
13년 전 조회 6,370
13년 전 조회 2,184
13년 전 조회 1,822
13년 전 조회 1,751
13년 전 조회 3,306
13년 전 조회 3,257
13년 전 조회 1,604
13년 전 조회 1,803
13년 전 조회 5,037
13년 전 조회 1,126
13년 전 조회 1,589
13년 전 조회 1,927
13년 전 조회 2,336
13년 전 조회 2,357