Detect the width of the browser window

  • Thread starter Thread starter Guest
  • Start date Start date
document.body.clientWidth

Why do you ask?

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
o--> Microsoft Visual Web Developer 2005 Express Edition: Build a Web Site
Now!
o--> Microsoft Office FrontPage 2003 Inside Out
o--> Microsoft Windows SharePoint Services Inside Out
o--> Faster Smarter Beginning Programming
 
i am asking because i want to adjust the size of the text on my site
according to the width of the browser window.

thanks!
 
Please don't.

Be a professional and make the site adjust to MY settings, not the other way
around. Most people I know hate when sites do that.
 
Your plan is doomed to fail because the visitor can resize the text anyway,
via View, Text Size. And while this doesn't affect text you size in px, in,
dm, mm, pt, or pc in IE, the corresponding command *does* resize those
measurements in Netscape, Forefox, and other browers.

The options under Tools, Internet Options, Accessability throw another
monkey wrench into your plans.

Jim Buyens
Microsoft MVP
http://www.interlacken.com
Author of:
o--> Microsoft Visual Web Developer 2005 Express Edition: Build a Web Site
Now!
o--> Microsoft Office FrontPage 2003 Inside Out
o--> Microsoft Windows SharePoint Services Inside Out
o--> Faster Smarter Beginning Programming
 
Back
Top