flexible.js 403 B

1234567891011
  1. (function flexible(window, document) {
  2. function resetFontSize() {
  3. console.log('111')
  4. const size = (document.documentElement.clientWidth / 1920) * 37.5;
  5. document.documentElement.style.fontSize = size + 'px';
  6. }
  7. // reset root font size on page show or resize
  8. window.addEventListener('pageshow', resetFontSize);
  9. window.addEventListener('resize', resetFontSize);
  10. })(window, document);