tab优化
This commit is contained in:
parent
41bca98a3c
commit
5d045b62e9
@ -57,22 +57,22 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
// JavaScript Document
|
// JavaScript Document
|
||||||
(function px2rem(doc, win) {
|
// (function px2rem(doc, win) {
|
||||||
var docEl = doc.documentElement,
|
// var docEl = doc.documentElement,
|
||||||
resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
|
// resizeEvt = "orientationchange" in window ? "orientationchange" : "resize",
|
||||||
recalc = function () {
|
// recalc = function () {
|
||||||
var clientWidth = docEl.clientWidth;
|
// var clientWidth = docEl.clientWidth;
|
||||||
if (!clientWidth) return;
|
// if (!clientWidth) return;
|
||||||
docEl.style.fontSize = 100 * (clientWidth / 750) + "px";
|
// docEl.style.fontSize = 100 * (clientWidth / 750) + "px";
|
||||||
};
|
// };
|
||||||
if (!doc.addEventListener) return;
|
// if (!doc.addEventListener) return;
|
||||||
// 窗口大小发生变化,初始化
|
// // 窗口大小发生变化,初始化
|
||||||
win.addEventListener(resizeEvt, recalc, false);
|
// win.addEventListener(resizeEvt, recalc, false);
|
||||||
doc.addEventListener("DOMContentLoaded", recalc, false);
|
// doc.addEventListener("DOMContentLoaded", recalc, false);
|
||||||
setTimeout(function () {
|
// setTimeout(function () {
|
||||||
px2rem(doc, win);
|
// px2rem(doc, win);
|
||||||
}, 200);
|
// }, 200);
|
||||||
})(document, window);
|
// })(document, window);
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
body,
|
body,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user