Solved

Show web browser size when changeing size of browser

Posted on 2013-11-19
5
357 Views
Last Modified: 2013-11-25
I wonder if there is any plugin or so that automatically displays the size of the browser when changing I change it's size?
0
Comment
Question by:mdoland
5 Comments
 

Expert Comment

by:Raymond Doran
ID: 39659352
What are you trying to accomplish?
0
 
LVL 15

Assisted Solution

by:unknown_routine
unknown_routine earned 167 total points
ID: 39659363
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);
</script>

Open in new window

0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 39659401
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);

to

window.status='Window width = '+winW+ '   '+'Window height = '+winH
0
 
LVL 30

Assisted Solution

by:Alexandre Simões
Alexandre Simões earned 166 total points
ID: 39659413
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 167 total points
ID: 39659417
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now