PC Review


Reply
Thread Tools Rate Thread

Detect the width of the browser window

 
 
=?Utf-8?B?WGVybw==?=
Guest
Posts: n/a
 
      7th Dec 2005
hello.

how do you detect the width of the browser window with javascript?
thanks.
--
Xero

http://www.chezjeff.net
My personal web portal
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmltIEJ1eWVucw==?=
Guest
Posts: n/a
 
      7th Dec 2005
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


"Xero" wrote:

> hello.
>
> how do you detect the width of the browser window with javascript?
> thanks.
> --
> Xero
>
> http://www.chezjeff.net
> My personal web portal

 
Reply With Quote
 
=?Utf-8?B?WGVybw==?=
Guest
Posts: n/a
 
      7th Dec 2005
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!

--
Xero

http://www.chezjeff.net
My personal web portal


"Jim Buyens" wrote:

> 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
>
>
> "Xero" wrote:
>
> > hello.
> >
> > how do you detect the width of the browser window with javascript?
> > thanks.
> > --
> > Xero
> >
> > http://www.chezjeff.net
> > My personal web portal

 
Reply With Quote
 
Murray
Guest
Posts: n/a
 
      7th Dec 2005
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.

--
Murray
============

"Xero" <jeff_at_chezjeff_dot_net> wrote in message
news:C7F399B7-A453-4DCD-8CBB-(E-Mail Removed)...
>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!
>
> --
> Xero
>
> http://www.chezjeff.net
> My personal web portal
>
>
> "Jim Buyens" wrote:
>
>> 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
>>
>>
>> "Xero" wrote:
>>
>> > hello.
>> >
>> > how do you detect the width of the browser window with javascript?
>> > thanks.
>> > --
>> > Xero
>> >
>> > http://www.chezjeff.net
>> > My personal web portal



 
Reply With Quote
 
=?Utf-8?B?SmltIEJ1eWVucw==?=
Guest
Posts: n/a
 
      7th Dec 2005
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


"Xero" wrote:

> 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!
>
> --
> Xero
>
> http://www.chezjeff.net
> My personal web portal
>
>
> "Jim Buyens" wrote:
>
> > 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
> >
> >
> > "Xero" wrote:
> >
> > > hello.
> > >
> > > how do you detect the width of the browser window with javascript?
> > > thanks.
> > > --
> > > Xero
> > >
> > > http://www.chezjeff.net
> > > My personal web portal

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slideshow width/heigh mismatch with window width/height Roland Microsoft Powerpoint 4 9th Apr 2007 03:48 PM
when text and images confine to width of window browser geegee Microsoft Frontpage 2 16th Aug 2006 10:54 AM
How can I detect a user has clicked the X to close the Browser Window tarun.kataria@gmail.com Microsoft ASP .NET 7 7th Apr 2006 05:27 AM
Stop a table filling the entire width of browser window Jane Here Microsoft Frontpage 2 9th Sep 2004 10:13 AM
Determing the width and height (in pixels) of a browser window Martin Underwood Windows XP Internet Explorer 0 25th Jul 2004 10:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:41 AM.