1.获取网页可见区域的宽度:document.body.clientWidth ; 2.获取网页可见区域的高度:document.body.clientHeight; 3.获取 网页可见区域宽:document.body.offsetWidth; (包括边线的宽度) 4.获取网页可见区域高:document.body.offsetHeight ;(包括边线的宽度) 5.获取网页正文全文宽:document.body.scrollWidth ; 6.获取网页正文全文高:document.body.scrollHeight ; 7.获取网页被卷去的高:document.body.scrollTop ; 8.获取网页被卷去的左:document.body.scrollLeft ; 9.获取网页正文部分上:window.screenTop ; 11.获取网页正文部分左:window.screenLeft; 12.获取屏幕分辨率的高:window.screen.height; 13.获取屏幕分辨率的宽:window.screen.width ; 14.屏幕可用工作区高度:window.screen.availHeight 15.屏幕可用工作区宽度:window.screen.availWidth
The above is the detailed content of How Js operates DOM and obtains browser height and width. For more information, please follow other related articles on the PHP Chinese website!