Home > Web Front-end > JS Tutorial > body text

ff Similarities and differences between global dynamic positioning under chrome and ie and how to obtain global height_javascript skills

WBOY
Release: 2016-05-16 16:42:39
Original
1098 people have browsed it

DTD declared

IE
document.documentElement.scrollHeight is the height of all content in the browser, document.body.scrollHeight is the height of all content in the browser
document.documentElement.scrollTop The height of the browser scrolling part, document.body.scrollTop is always 0
document.documentElement.clientHeight is the height of the visible part of the browser, document.body.clientHeight is the height of all content in the browser

FF
document.documentElement.scrollHeight is the height of all content in the browser, document.body.scrollHeight is the height of all content in the browser
document.documentElement.scrollTop The height of the browser scrolling part, document.body.scrollTop is always 0
document.documentElement.clientHeight is the height of the visible part of the browser, document.body.clientHeight is the height of all content in the browser

Chrome
document.documentElement.scrollHeight is the height of all content in the browser, document.body.scrollHeight is the height of all content in the browser
document.documentElement.scrollTop is always 0, document.body.scrollTop is the height of the browser scrolling part
document.documentElement.clientHeight is the height of the visible part of the browser, document.body.clientHeight is the height of all content in the browser

DTD not declared

IE
document.documentElement.scrollHeight is the height of the visible part of the browser, document.body.scrollHeight is the height of all content in the browser
document.documentElement.scrollTop is always 0, document.body.scrollTop is the height of the browser scrolling part
document.documentElement.clientHeight is always 0, document.body.clientHeight is the height of the visible part of the browser

FF
document.documentElement.scrollHeight is the height of the visible part of the browser, document.body.scrollHeight is the height of all content in the browser
document.documentElement.scrollTop is always 0, document.body.scrollTop is the height of the browser scrolling part
document.documentElement.clientHeight is the height of all content in the browser, document.body.clientHeight is the height of the visible part of the browser

Chrome
document.documentElement.scrollHeight is the height of the visible part of the browser, document.body.scrollHeight is the height of all content in the browser
document.documentElement.scrollTop is always 0, document.body.scrollTop is the height of the browser scrolling part
document.documentElement.clientHeight is the height of all content in the browser, document.body.clientHeight is the height of the visible part of the browser

The height of all content in the browser is the height of the entire frame of the browser, including the sum of the heights of the part where the scroll bar is rolled out, the visible part, and the hidden part at the bottom

The height of the scrolled part of the browser is the height of the scroll bar, which is the height of the visual top from the top of the entire object.

DTD declaration refers to the declaration when the browser page is loaded:

Declare document type html

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!