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.
shipin_qianduan/public/flexible.js

11 lines
379 B

10 months ago
(function flexible(window, document) {
function resetFontSize() {
const size = (document.documentElement.clientWidth / 375) * 37.5;
document.documentElement.style.fontSize = size + 'px';
}
// reset root font size on page show or resize
window.addEventListener('pageshow', resetFontSize);
window.addEventListener('resize', resetFontSize);
})(window, document);