I have a working "Cookies" solution.
The thing is you'll have to edit the pages that you are loading into the iframes.
I only worked with 1 iframe but you'll have to modify the code so that a cookie is set by each page you're loading and that the code loading the iframe retrieves these cookies and sets the sizes accordingly.
So, like I said I only worked with 1 iframe.
I set a cookie called "heightCookie" to the physical height of the window + the scroll height of the window (the height of the content) in the page I was loading in the iframe:
-
<html>
-
<head>
-
<script type="text/javascript">
-
function setCookie()
-
{
-
var value = document.body.offsetHeight + document.body.scrollHeight+ "px";
-
var c_name = "heightCookie";
-
document.cookie= c_name + "=" + value;
-
}
-
</script>
-
<body onload="setCookie();">
-
......
-
</body>
-
</html>
Then in the page that loads the HTML into the iframe I retrieve the heightCookie's value during the iframe's onload event and set the height of the iframe:
-
<html>
-
<head>
-
<script type="text/javascript">
-
function getHeight()
-
{ var c_name = "heightCookie";
-
if (document.cookie.length>0)
-
{
-
c_start=document.cookie.indexOf(c_name + "=");
-
if (c_start!=-1)
-
{
-
c_start=c_start + c_name.length+1 ;
-
c_end=document.cookie.indexOf(";",c_start);
-
if (c_end==-1) c_end=document.cookie.length
-
return unescape(document.cookie.substring(c_start,c_end));
-
}
-
}
-
return "";
-
}
-
-
function autoResize(element)
-
{
-
element.style.height = getHeight();
-
}
-
</script>
-
</head>
-
<body>
-
<iframe onload="autoResize(this);" src="HideShowColumnsTest.html" id="testing"></iframe>
-
</body>
-
</html>
It would probably be a good idea to load save cookies named according the the page name...and during the onload event pass the page name into the "autoResize" method...which passes it onto the getHeight method so that it retrieves the proper cookie for the iframe it's modifying.
I haven't tested it across domains...I hope it works for you.