[thelist] Browser innerWidth for IE4/5/6?

Terry Fowler fowlerpeople at yahoo.com
Thu May 24 13:08:10 CDT 2001

--- Peter-Paul Koch <gassinaumasis at hotmail.com> wrote:
> IE needs document.body.clientWidth. 

In the spirit of "Give a man a fish, feed him for a
day, teach a man to fish and he'll never show up for
work," how did you know it was clientWidth? Where 
should I have looked?

>Your current browser detect is incorrect, it leaves 
>out Netscape 6 and the minor browsers. 

heh, it's Dan Steinman's detect and is probably a few
years out of date. No mention of IE5 in the tutorial.
The copyright is 1998, so I don't think he's updating
it. But it's still great for the basics.

> Besides, detecting the browser is not necessary
> >function init() {
> if (self.innerWidth) redLight = self.innerWidth
> else if (document.body) redLight =
> document.body.clientWidth
Just tried this and it works like a charm. Thanks!


Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices

More information about the thelist mailing list