View Full Version : Dynamic window information...


DEfusion
06-27-2003, 05:19 PM
I have this script to set the height of a iframe window to the appropriate size depending on the size of the browser window (minusing the size of other elements on the page - which the size is known for).

This script is:

<script language="javascript">
<!--
// Simple Browser Check
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;

// Browser Window Dimensions
function winHei(){ return (ns4||ns6) ? window.innerHeight : document.body.clientHeight; }

var displayheight = winHei() - 275;
document.write('<style type=\"text/css\">');
document.write('#fulliframe { height: '+displayheight+'px; width: 100%; }');
document.write('</style>');
-->
</script>

But this only sets the iframe setting height on the document load, if the user re-sizes the browser at any point then, until a new page is loaded, things arn't so good as they could be.

Is there anyway to get this to work dynamically (i.e. the javascript to keep updating the height).

Any ideas?

-D