tab优化

This commit is contained in:
zhanglipeng 2021-06-05 21:00:17 +08:00
parent 41bca98a3c
commit 5d045b62e9

@ -57,22 +57,22 @@ export default {
},
};
// JavaScript Document
(function px2rem(doc, win) {
var docEl = doc.documentElement,
resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
recalc = function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
docEl.style.fontSize = 100 * (clientWidth / 750) + "px";
};
if (!doc.addEventListener) return;
//
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener("DOMContentLoaded", recalc, false);
setTimeout(function () {
px2rem(doc, win);
}, 200);
})(document, window);
// (function px2rem(doc, win) {
// var docEl = doc.documentElement,
// resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
// recalc = function () {
// var clientWidth = docEl.clientWidth;
// if (!clientWidth) return;
// docEl.style.fontSize = 100 * (clientWidth / 750) + "px";
// };
// if (!doc.addEventListener) return;
// //
// win.addEventListener(resizeEvt, recalc, false);
// doc.addEventListener("DOMContentLoaded", recalc, false);
// setTimeout(function () {
// px2rem(doc, win);
// }, 200);
// })(document, window);
</script>
<style>
body,