wlcb-syzl-dsj/js/rem.js

13 lines
304 B
JavaScript
Raw Normal View History

2022-07-13 12:17:14 +08:00
function setPage() {
var html = document.getElementsByTagName('html')[0];
var deviceWidth = document.documentElement.clientWidth;
var scale = deviceWidth / 7424;//psd图上的宽度
html.style.fontSize = scale * 100 + 'px';
}
setPage();
window.onresize = function () {
setPage();
}