JS浏览器和电脑分辨率宽高

1 let width = document.body.clientWidth  //浏览器宽度
2 let height= document.body.clientHeight  //浏览器高度
3 
4 //电脑分辨率
5 let cHeight = screen.height
6 let cWidth = screen.width

 

posted @ 2020-08-28 16:17  yw3692582  阅读(209)  评论(0编辑  收藏  举报