星火官网,前端页面(前台)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 1 година
1234567891011121314151617
  1. (function (doc, win) {
  2. var docEl = doc.documentElement,
  3. resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
  4. recalc = function () {
  5. var clientWidth = docEl.clientWidth; //获取设备尺寸
  6. if (!clientWidth) return;
  7. if (clientWidth >= 1920) {
  8. //设计稿宽度
  9. docEl.style.fontSize = "100px";
  10. } else {
  11. docEl.style.fontSize = 100 * (clientWidth / 1920) + "px";
  12. }
  13. };
  14. if (!doc.addEventListener) return;
  15. win.addEventListener(resizeEvt, recalc, false); //绑定事件
  16. doc.addEventListener("DOMContentLoaded", recalc, false);
  17. })(document, window);