// 计算html的font-size
(function(){
function resizeBaseFontSize(){
var rootHtml = document.documentElement,
deviceWidth = rootHtml.clientWidth;

if(deviceWidth > 640){
deviceWidth = 640;
}

rootHtml.style.fontSize = deviceWidth / 7.5 + "px";
}

resizeBaseFontSize();

window.addEventListener("resize", resizeBaseFontSize, false);
window.addEventListener("orientationchange", resizeBaseFontSize, false);
})();

相关文章:

  • 2022-12-23
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
相关资源
相似解决方案