embed iframe

Here is a simple JS presented that automatically calculates the height of an iframe.

Forum: Dynamisches DIV Layout mit iframe?!

Author: ??



In header (HTML-Header!!!):

iframe head

<script language="JavaScript" type="text/javascript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=document.getElementById('iframename').contentWindow.document.body.scrollHeight;
 
//change the height of the iframe
document.getElementById('iframename').height=the_height +15;
}
//-->
</script>


DIV - middle:

<iframe name="iframename" onLoad="calcHeight();" scrolling="no" width="100%" frameborder="0" id="iframename"src="http://www.example.com"></iframe>

<note> This script only works for pages on your own domain. </note>

english/other-enhancements/iframe.txt · Last modified: 2018/06/03 18:09 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0