oswald8
06-10-2008, 04:46 AM
:eek:Hi! I found this code online that could make my iframe vary height depending on its content. It works awsomely in IE, but in mozilla firefox, it's a diffrent story! The frame expands well with the content, but it never shrinks back. Can anyone help me?
here's my page: www.luckyoswald.net (http://www.luckyoswald.net)
For the code, I pasted this in the head of my main page (the one that contains the iframe)
------------------------
<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>
------------------------
and this is my iframe tag
------------------------
<iframe width="741" id="the_iframe"
onLoad="calcHeight();"
onload=resize_iframe
src="blog.htm"
scrolling="no"
frameborder="0"
height="1" marginwidth="1" marginheight="1" name="I1" border="0">
</iframe>
------------------------
thanks in advance!
here's my page: www.luckyoswald.net (http://www.luckyoswald.net)
For the code, I pasted this in the head of my main page (the one that contains the iframe)
------------------------
<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>
------------------------
and this is my iframe tag
------------------------
<iframe width="741" id="the_iframe"
onLoad="calcHeight();"
onload=resize_iframe
src="blog.htm"
scrolling="no"
frameborder="0"
height="1" marginwidth="1" marginheight="1" name="I1" border="0">
</iframe>
------------------------
thanks in advance!