Just thought I would fill you in on my experience with the iframe ssi resize script. Maybe some of this should go into the configuration info.
The script will not work on an iframe with a php source. It will work for html src files.
So I thought really hard about it and came up with the following solution: (this is assuming the page are local)
This code will go on the iframe src page in the header.
Code:
<script type="text/javascript">
function iframeresize()
{
var divh = document.getElementById('top').offsetHeight;
parent.document.getElementById('targetframe').style.height = divh+10+'px';
}
</script>
This code will be in the iframe src page body tag
Code:
<body onload="iframeresize()">
On the iframe src page you will need to wrap the entire page content in a div tag with an id, I used top.
On the parent page your iframe tag will look like this
Code:
<iframe src="include/new_input.php" name="targetframe" id="targetframe" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:700px; height:600px;"></iframe>
Then to change the iframe source from a link, I use this script which I got from dyn-web.com:
Put this on the parent page
Code:
<script type="text/javascript">
// <![CDATA[
/* Free code from dyn-web.com */
function changeIframeSrc(id, url) {
if (!document.getElementById) return;
var el = document.getElementById(id);
if (el && el.src) {
el.src = url;
return false;
}
return true;
}
// ]]>
</script>
Your links will look like this:
Code:
<a href="new_input.php" onclick="return changeIframeSrc('targetframe', this.href)">
So basically the first function will get the height of the div from the iframe, then it will change the height value of the style for the iframe on the top page to be the same height as the div on the iframe. I add another 10px just to be sure.
Then the other script just makes it so that links will target the iframe. As long as you have the first function and the onload in the body tag of the new src for the iframe it will resize it every time. If you have questions let me know.
Bookmarks