Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1341 How can I determine the height and width of the window or frame?

irt.org | Knowledge Base | JavaScript | Window | Q1341 [ previous next ]

Q1341 How can I determine the height and width of the window or frame?

Try:

<body>

<script language="JavaScript"><!--
var width = 640, height = 480; // defaults
if (document.layers) {
    width = window.innerWidth;
    height = window.innerHeight;
}
else if (document.all) {
    width = document.body.clientWidth;
    height = document.body.clientHeight;
}
//--></script>

....

</body>

Feedback on 'Q1341 How can I determine the height and width of the window or frame?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.