Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Window | Q1341 [ previous next ]

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?'

©2018 Martin Webb