header
 
     
 
pixel
pixel pixel

Determine the width of the browser window

This javascript gives you the width of your browser window, useful if your design depends on the size of the screen. Note that Netscape & Internet Explorer both use different variable names.
<script language=javascript>
if(navigator.appName == "Netscape")
    { 
    windowwidth = window.innerWidth;
    }
else if(navigator.appName == "Microsoft Internet Explorer")
    { 
    windowwidth = document.body.clientWidth;
    }
</script>

Unhelpful Helpful Rating 3.1 (score out of 5, no. of ratings: 32)
Comments
Comment by matt on 2005-12-05
is there a way to detect height of the browser window thanks?

Comment by Ian on 2009-12-21
This only provides the size of the current FRAME - not the overall browser window. Any ideas?

Comment by Irene on 2011-05-21
That?s more than ssenbile! That?s a great post!

Comment by discount Michael Jordan Shoes on 2010-09-17
Air Jordan Shoes are always so attractive, good quality can ensure the wearer's feet, not only that, the Michael Jordan Shoes has become a fashion, many young people are very fanatical Air Jordan. High price so many people can realize their dreams. Well now, our products directly from third-party products, so we can provide cheap Jordan Basketball Shoes and New Jordan Shoes, high quality, excellent service, come on, give yourself a choice. We offerAir Jordan 1, Air Jordan 2, Air Jordan 3,Air Jordan 4, Air Jordan 5, Air Jordan 6, Air Jordan 7, Air Jordan 8, Air Jordan 9, Air Jordan 10, Air Jordan 11 and so on!

Post a Comment
Name
Email
(optional)
Comment
RatingUnhelpful Helpful
Security Image* (this is just to prevent spam submissions)
Security Image