码迷,mamicode.com
首页 > 移动开发 > 详细

移动端适配

时间:2018-04-12 13:27:27      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:nts   html   dev   code   res   list   return   htm   event   

var refreshRem=(function refreshRem(){
    var deviceWidth=document.documentElement.clientWidth;
    deviceWidth=Math.max(Math.min(420,deviceWidth),320);
    document.getElementsByTagName(html)[0].style.fontSize=(deviceWidth/750)*100+px;
    return refreshRem;
})();
var resizeEvt = orientationchange in window ? orientationchange : resize;
window.addEventListener(resizeEvt,refreshRem,false);

@function rem($px){
  @return $px / 100 + rem;
}

 

移动端适配

标签:nts   html   dev   code   res   list   return   htm   event   

原文地址:https://www.cnblogs.com/intangible/p/8806818.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!