Jump to content
  • 0

Iframe Auto Resize Height


ppbb123

Question

6 answers to this question

Recommended Posts

  • 0

Hello,

 

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

=================================
<head>
<script>
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";
}
window.onload=iframeLoad;
</script>
</head>

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

</body>

=================================

 

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

 

I hope this helps.

 

Thanks

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">
  <!--DWLayoutTable-->
  <tr>
    <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>
  </tr>
  <tr>
    <td height="105" valign="top"></td>
  </tr>
  <tr>
    <td height="100" valign="top"></td>
  </tr>
</table>
 
 
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.

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

Loading...
×
×
  • Create New...