In article <MP************************@nntp.lucent.com>,
ti******@NOSPAM.comcast.net enlightened us with...
An idea, untested: hack your content a bit by sticking it all in a div
that is set to take up all available space, but can overflow the window
size, then get the height and width of the div if you can (browser-
dependent), then resize the window to the height and width of the div.
I don't think you can get the height of the body element itself, but you
can try. You could also try getting the document size and see if that's
it. If you can get those, I don't know if they'd give you the height and
width you'd be looking for.
I decided to play a bit and the div idea didn't work too well in NN/Moz,
so I've gotten this far with window values. The values aren't the
greatest and more needs to be done to size properly for NN/IE, but it's
a start. Note that NN and IE come up with different numbers for the
height and the height in IE doesn't take the top of the window into
account, so it's too small a window by that amount, which will vary
system to system.
Others I tried already that didn't work well:
win.document.body.offsetHeight: IE worked, NN always had 0
win.innerHeight: NN worked, IE=undefined
win.document.body.clientHeight; // IE same as OH, NN same as IH, so
kept this
Have fun. I have to go home now.
--------------test.html---------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> New Document </title>
<script type="text/javascript" language="javascript">
function openIt()
{
var win = window.open("test2.html","","height=200,width=200" );
var ch = win.document.body.clientHeight;
var cw = win.document.body.clientWidth;
alert("clientHeight: "+ch+"\n"+
"clientWidth: "+cw);
//win.resizeTo(w,h);
//win.focus();
}
</script>
</head>
<body>
<form id="f1" name="f1">
<br>
<input type="button" name="btn1" value="try it" id="btn1"
onclick="openIt()">
</form>
</body>
</html>
--------------test2.html---------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>test </title>
<style type="text/css">
body {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<p>this is the start of the content.</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is the end of the content.</p>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>test </title>
<style type="text/css">
body {
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<p>this is the start of the content.</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is test page #2</p>
<p>this is the end of the content.</p>
</body>
</html>
--
--
~kaeli~
If you don't pay your exorcist, you get repossessed.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace