• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

Show web browser size when changeing size of browser

I wonder if there is any plugin or so that automatically displays the size of the browser when changing I change it's size?
3 Solutions
Raymond DoranSenior ConsultantCommented:
What are you trying to accomplish?
Just copy/ paste this code to your HTML(paste
it to wherever you want size of browser be printed)

<script type="text/javascript">
var winW = 630, winH = 460;
if (document.body && document.body.offsetWidth) {
 winW = document.body.offsetWidth;
 winH = document.body.offsetHeight;
if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
 winW = document.documentElement.offsetWidth;
 winH = document.documentElement.offsetHeight;
if (window.innerWidth && window.innerHeight) {
 winW = window.innerWidth;
 winH = window.innerHeight;

document.writeln('Window width = '+winW);
document.writeln('Window height = '+winH);

Open in new window

If you want to just see the size in the Statusbar of the browser, change
document.writeln('Window width = '+winW);
document.writeln('Window height = '+winH);


window.status='Window width = '+winW+ '   '+'Window height = '+winH
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
In Chrome, if you switch to the console view, as you size the browse, the width and height appear in real time in the upper right corner.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now