[thelist] document.body.clientHeight problems in IE6?

Richard Bennett richard.bennett at skynet.be
Tue Jan 22 17:56:30 CST 2002


Hi
----- Original Message -----
From: "Ben Henick" <persist1 at io.com>

> HVal = document.body.clientHeight;
> InlineNav.style.top =
> ((HVal - parseInt(document.body.style.lineHeight) * 2) + "px");

> If someone who's got IE6 could take a look and clue me into what's going
> on, that'd be fantastic, as I'm still using IE5.5...

That's because you're either using the "strict" doctype, or any doctype
containing a URL - this switches IE6 into "Strict" mode.

So, either just delete the doctype.
Or use "transitional", without a URL.
Or, use Javascript to sniff which mode you're in, and code accordingly, like
this:

HVal
=(document.compatMode=="CSS1Compat")?document.documentElement.clientHeight :
document.body.clientHeight;

That's all on one line, and untested.

BTW - I heard in passing that Mozilla will also support compatMode from the
next version (or current CVS code)


Cheers,
Richard.









More information about the thelist mailing list