screen对象包含有关客户端显示屏幕的信息screen.availWidthscreen.availHeight// 获取屏幕的宽度var screenWidth = window.screen.availWidth;console.log(screenWidth);// 获取屏幕的可视区var viewWidth = document.body.clientWidth;console.log(viewWidth);