I am trying to access Javascript variables in an Iframe statement to be able to dynamically change the WIDTH and HEIGHT of the iframe based on the current browser window size.
It is for an IE specific browser based application and I am utilizing the following code.
I am a designer with limited programming experience.
The code I have borrowed is IE specific and was told to place it in the body of the html and when the page is resized the iFrame will resize accordingly.
WIDTH=mainWidth and WIDTH=mainHeight does not work of course but this is where I am stuck.
It is for an IE specific browser based application and I am utilizing the following code.
I am a designer with limited programming experience.
The code I have borrowed is IE specific and was told to place it in the body of the html and when the page is resized the iFrame will resize accordingly.
WIDTH=mainWidth and WIDTH=mainHeight does not work of course but this is where I am stuck.
Code:
<body onload="makeUnits();" onResize="history.go(0);" scroll="no">
<script language="JavaScript1.2">
function makeUnits() {
mainHeight = document.body.clientHeight;
mainWidth = document.body.clientWidth;
}
</script>
<DIV class="mainFrame">
<IFRAME SRC="blank.htm" align="center" NAME="mainframe" SCROLLING="No" WIDTH=mainWidth HEIGHT=mainHeight MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER="No"></IFRAME>
</DIV>