[snip]
- I didn't handle the height bug in Opera 9 in this example, there'sa
test and workaround for that in the group FAQ.
That entry needs some rewriting.
"What the number returned from either of these properties represents
depends on the environment. The environment includes the browser, its
version, and the rendering mode of the document. In quirks mode, we'll
mostly want to use body.clientHeight (except for in Safari 2)."
What it boils down to is the outermost scrolling element. Normally
this is the documentElement. In IE quirks mode (and IE < 6), it is
the body.
" document.body.clientHeight
Some environments will return the viewport height. Others will return
0. Yet others will return the clientHeight of the BODY element."
"I don't know about 0, except not to use it, most will indeed return
the client height of the body, which may or may not be a good starting
point for determining the viewport height (depends if it is the
outermost scrolling element.)
document.documentElement.clientHeight
This is the more "standard" property for getting the height of the
viewport. It usually "works" in modern browsers in standards mode."
No, this is the standard way to measure the client height of the
documentElement. In IE quirks mode (and IE < 6), it is 0, which is a
great indicator that it is useless (the HTML element is not rendered.)
"Notable exceptions include Safari 2 and Opera <= 9.25, both of which
return the clientHeight of the html element. (Oddly, Opera <= 9.25 in
standards mode returns the width of the viewport for
documentElement.clientWidth)."
Not sure about Safari 2, but the Opera problem is that it returns the
scrollHeight instead of the clientHeight (and this bug is not present
inclientWidth.)
"Conversely, document.body.clientHeight will return the height of the
viewport in most cases where document.documentElement.clientHeight
does not. An exception to that is Safari 2, where
documentElement.clientHeight and body.clientHeight both return the
height of their corresponding element (not what we want). "
The client height of the outermost scrolling element is exactly what
we want.