Jump to content

[SOLVED] auto iFrame height and website height


tushar707

Recommended Posts

  • 2 years later...

Below is some javascript code that will automatically expand the iframes that we currently use to embed forms.

 

(1) Paste The blow to the head

 

<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>

(2)Paste the code below to the body and replace "your page here" with your url

 

 

<iframe width="100%" id="the_iframe"
onLoad="calcHeight();"
src="your page here"
scrolling="NO"
frameborder="0"
height="1">
An iframe capable browser is
required to view this web site.
</iframe>

 

I hope this helps others wonting this solution

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.