[thelist] In Javascript: how to get browser's dimensions?

Chris Blessing webguy at mail.rit.edu
Wed Nov 28 17:19:28 CST 2001


With Netscape you can detect it using:

window.innerWidth
window.innerHeight

And for IE or any document.all browser you can get it with:

document.body.clientWidth
document.body.clientHeight

-Chris

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Alliax
Sent: Wednesday, November 28, 2001 6:08 PM
To: thelist at lists.evolt.org
Subject: [thelist] In Javascript: how to get browser's dimensions?


Hi,
I have been through O'Reilly docs on Javascript but couldn't find any
reference
to browser size (neither on IE nor NN).
I know we can do window.resizeto() and specify width and height
I know we can get the screen resolution with screen.width and scree.height
But what about the browser current dimensions?

Is it impossible to get in javascript?
If so, do you have an explanation for this, since getting an application's
window size seems pretty basic, so why not updating the javascript
environment
variables if the browser get resized by the user ?

Thank you



---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list