...

View Full Version : Changing IFRAME height in Mozilla & FF



Srikanth.S
08-30-2006, 01:47 PM
Hi All,

I'm loading a DIV element over an IFRAME, the DIV element contains a table in which I'm dynamically creating table rows. The DIV element height icreases on dynamic row creation, simultaneously the IFRAME height has to be increased to the DIV element height. I tried the following code,


document.getElementById('testIframe').style.height = document.getElementById('testDiv').offsetHeight;

it works well in IE & Opera but not in Mozilla & FireFox.

How to increase IFRAME height dynamically as I said above in Mozilla & FireFox.

vwphillips
08-30-2006, 04:00 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


<head>
<title></title>
</head>

<body>
<iframe id="fred" src="a.htm" width="800" height="100"></iframe>
</body>

</html>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


<head>
<title>a.htm</title>
<script language="JavaScript" type="text/javascript">
<!--
function Cng(){
if (window.parent.document.getElementById('fred')){
window.parent.document.getElementById('fred').style.height='300px';

}

}
//-->
</script>
</head>

<body>
<div style="width:100px;height:100px;background-color:red;"
onclick="this.style.height='200px';Cng();"

></div>
</body>

</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum