美娱国际:JS制作手机端自适应缩放显示

标签:业务范围    日期:2019-01-30 10:42    录入:美娱国际平台注册    浏览:

  

[JS,手机端自适应缩放]JS制作手机端自适应缩放显示

  

JS???美娱国际注册

  

  

??

  

  
  
  var _width = parseInt(window.screen.width);  var scale = _width/640;  var ua = navigator.userAgent.toLowerCase();  var result = /android (\d+\.\d+)/.exec(ua);  if (result){  var version = parseFloat(result[1]);  if(version>2.3){  document.write('');  }else{  document.write('');  }  } else {  document.write('');  }  
  
  

?

  

  
  
  $(function(){  if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {  var viewportmeta = document.querySelector('meta[name="viewport"]');  if (viewportmeta) {  viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';  document.addEventListener('touchstart', function () {  viewportmeta.content = 'viewportmeta.content = width=device-width, minimum-scale=0.25, maximum-scale=1.6';  }, false);  document.addEventListener('orientationchange', function () {  viewportmeta.content = 'viewportmeta.content = width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0';  }, false);  }  }  });  
  
  

?

  

  
  
          
  
  

  

  

??

  

  

?.?? ????viewport??

  

  

  

  

. ?t? ??????t??????tо????

  

  

. ?С ??t?Сpx???Сem  

  

. ?fluid grid ""??λ??????

  
  .main { float: right; width: 70%; } .leftBar { float: left; width: 25%; }  

  

. ???fluid image ???"??"?????

  

  

???????

  

★★★小编:美娱国际 整理文章,欢迎大家转载 ★★★
上一篇:javascript网页关闭时提醒效果脚本
下一篇:没有了
相关文章阅读