Whether in writing or mobile pc side end, we always encounter the height of the issue. div element height, the height of the parent element, the screen height, the height of the window, the visible range of height, etc., each Dounong disoriented, then the next step is for Baidu, so their own order a bit, a good understanding.
- The visible area of the page width: document.body.clientWidth
- Highly visible page area: document.body.clientHeight
- Page wide visible region: document.body.offsetWidth (including edge width)
- Highly visible page area: document.body.offsetHeight (including high edges)
- Full body of the page width: document.body.scrollWidth
- Body of the page GAO: document.body.scrollHeight
- Page volume to be high: document.body.scrollTop
- Web is rolled to the left: document.body.scrollLeft
- On the body of the page: window.screenTop
- The body of the page left: window.screenLeft
- High screen resolution: window.screen.height
- Wide screen resolution: window.screen.width
- Screen available work area height: window.screen.availHeight
- Available Workspace screen width: window.screen.availWidth
Commonly used to contain a wide border height difference document.body.offsetHeight and document.body.clientHeight, both, does not contain, it is relatively simple, Duokanjibian, practical operation it will be able to remember.
All can be on in the browser page, in the end how to move these to calculate the height of it?
1, to obtain the phone screen height
2. Gets the height of the status bar phone
3. Gets the height of the input method
4, Gets the height of the webview