|
Q1400 How do I measure the height of my document?
irt.org | Knowledge Base | DHTML | Q1400 [ previous next ]
Q1400 How do I measure the height of my document?
In Internet Explorer 4+:
<script language="JavaScript"><!--
function height() {
if (document.all)
alert('Document height = ' + document.body.offsetHeight);
}
//--></script>
|
If you must have the height in Netscape Navigator then include the
complete page contents in a layer:
<html>
<head>
<script language="JavaScript"><!--
function height() {
if (document.all)
alert('Document height = ' + document.body.offsetHeight);
else if (document.layers)
alert('Document height = ' + document.body.document.height);
}
//--></script>
</head>
<body onLoad="height()">
<ilayer id="body">
*** Place your page contents in here ***
</ilayer>
</body>
</html>
|
Feedback on 'Q1400 How do I measure the height of my document?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.