VirtualG
03-09-2009, 08:37 AM
If you are getting angry with you're iframes because they do not expand to the correct size, this is a quick and easy way to get them to expand to the correct height.
Step one:
insert the following code into the head tags:
<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindo w.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>
(replace 'the_iframe with the iframe id.)
Step Two:
Put onload="calcheight()" into you're iframe tags (make sure there is no height specified) and you're done!
__________________________________________________ __________________________________________________ ____________
Easy or what? I hope you enjoyed it, it's used for more 'novice' coders. I just saw a post with someone asking how to do it.
Step one:
insert the following code into the head tags:
<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindo w.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>
(replace 'the_iframe with the iframe id.)
Step Two:
Put onload="calcheight()" into you're iframe tags (make sure there is no height specified) and you're done!
__________________________________________________ __________________________________________________ ____________
Easy or what? I hope you enjoyed it, it's used for more 'novice' coders. I just saw a post with someone asking how to do it.