1. 程式人生 > >移動端適配

移動端適配

tel onchange win fun window IE AR max wid

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; }

移動端適配