一是尔,getBoundingClientRect()
//方法包含:left, top, right, bottom, x, y, width, and height
//使用:const documentWidth=document.body.getBoundingClientRect().width;
//配合:window.addEventListener("resize",()=>{doSomthing})
// 常見尺寸:1200 992 768
//方法包含:left, top, right, bottom, x, y, width, and height
//使用:const documentWidth=document.body.getBoundingClientRect().width;
//配合:window.addEventListener("resize",()=>{doSomthing})
// 常見尺寸:1200 992 768