window.onload = function() {
onsize()
}
window.onresize = function() {
onsize()
}
function onsize() {
var deviceWidth = document.documentElement.clientWidth;
if (deviceWidth > 720) {
deviceWidth = 720;
}
var fs = (deviceWidth * 100) / 720;
document.documentElement.style.fontSize = fs + 'px';
}
js媒体查询
最新推荐文章于 2024-08-08 22:52:12 发布