Jump to content
  • 0

Iframe Auto Resize Height



6 answers to this question

Recommended Posts

  • 0



I think I may have a script that will help you, place this script in the webpage or the DataPage where you have iframe:

function iframeLoad(){
var iframe = document.getElementById("myFrame");
var x = 100; //This is padding of the iframe if there’s any
var height = iframe.contentWindow.document.body.scrollHeight + x;
iframe.style.height =  height+"px";

<body onload="iframeLoad()">
<iframe id="myFrame"  src="URL.htm">Sorry, but your browser does not support frames.</iframe>




Basically within the body, you will need to place the iframe deployment code with the unique id for the iframe.


I hope this helps.



Link to comment
Share on other sites

  • 0

This code doesn't work on my datapage. I have a datapage (http://b6.caspio.com/embedded form...) embedded on my site (www.site.com) within a table. I then have another datapage (search and report, list results only; http://b6.caspio/iframe form...) within in iframe on the details page of the embedded form, ie.  <iframe>src=http://b6.caspio/iframe form...</iframe>. The iframe is within a table, the code of which is in a HTML block of http://b6.caspio.com/embedded form...


Here is the code within the html block of http://b6.caspio.com/embedded form...


<table width="200" border="0" cellpadding="0" cellspacing="0">
    <td width="200" height="112" valign="top"><iframe frameborder=no; scrolling="no"; style="width:100%; height:400px" name="contact_form" title="contact_form" src="http://b6.caspio/iframe form...">Sorry, but your browser does not support frames.</iframe>
    <td height="105" valign="top"></td>
    <td height="100" valign="top"></td>
Thanks for the help.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...