rem.js 558 B

1234567891011
  1. !new function () {
  2. var a = this;
  3. a.width = 750, a.fontSize = 100, a.widthProportion = function () {
  4. var b = (document.body && document.body.clientWidth || document.getElementsByTagName("html")[0].offsetWidth) / a.width;
  5. return b > 1 ? 1 : b
  6. }, a.changePage = function () {
  7. document.getElementsByTagName("html")[0].setAttribute("style", "font-size:" + Math.floor(a.widthProportion() * a.fontSize) + "px !important")
  8. }, a.changePage(), window.addEventListener("resize", function () {
  9. a.changePage()
  10. }, !1)
  11. };