首页 > 代码库 > 兼容手机端页面

兼容手机端页面

(function(){
var iScale = 1;
iScale = iScale / window.devicePixelRatio;
document.write(‘<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=‘ + 1 + ‘,minimum-scale=‘ + 1 + ‘,maximum-scale=‘ + 1 + ‘">‘)
var iWidth = document.documentElement.clientWidth;
var iFontSize = iWidth/27.3;
document.getElementsByTagName("html")[0].style.fontSize=iFontSize+"px";
})();

兼容手机端页面