1. 程式人生 > >css移動端單位轉換 px 轉rem

css移動端單位轉換 px 轉rem

(function (a, d) {
    var b = a.documentElement, e = "onorientationchange" in window ? "onorientationchange" : "resize", c = function () {
        var a = b.clientWidth;
        a && (b.style.fontSize = 750 <= a ? "100px" : a / 750 * 100 + "px")
    };
    a.addEventListener && (d.addEventListener
(e, c, !1), a.addEventListener("DOMContentLoaded", c, !1)); })(document, window);