Home > Web Front-end > JS Tutorial > Description of the method of obtaining height and width in js_Basic knowledge

Description of the method of obtaining height and width in js_Basic knowledge

WBOY
Release: 2016-05-16 17:44:17
Original
967 people have browsed it
Copy code The code is as follows:




< title>js gets height and width summary







  • Web page visible area width: document.body.clientWidth
  • The height of the visible area of ​​the web page: document.body.clientHeight

  • The width of the visible area of ​​the web page: document.body.offsetWidth (including the width of the edge) li> >
  • The left side of the web page being scrolled: document.body.scrollLeft

  • The main part of the web page: window.screenTop

  • Text part left: window.screenLeft

  • The height of the screen resolution: window.screen.height

  • The width of the screen resolution: window.screen .width

  • Screen available work area height: window.screen.availHeight

  • Screen available work area width: window.screen.availWidth




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