I have a page with an iframe. The iframe contents sometimes do dynamic JS things that cause them to grow. When thta happens, I have to resize the iframe to make sure it's long enough, which I do with this, inside the iframe:
// I saved you the boredom of all the try{}s and != nulls, this is just the meat.
document.parentWindow.parent.reSize();
And this, which is in the parent html:
function reSize()
{
try
{
var oBody = ifrm.document.body;
var oFrame = document.all('ifrm');
oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight) + 100;
}
//An error is raised if the IFrame domain != its container's domain
catch(e) { }
}
However, calls to this are littered all over, in every place where resizing might have happened. Is there anywhere I can put this such that it is "automatic"? Some event I can trigger off of or something?
Relevant links: