Home > Web Front-end > JS Tutorial > How Js operates DOM and obtains browser height and width

How Js operates DOM and obtains browser height and width

一个新手
Release: 2017-10-09 09:45:52
Original
1519 people have browsed it

    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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template