So, I stole the script off the internet. Basically, it’s supposed to resize an iframe to fit its content.
function sizeIFrame()
{
var helpFrame = jQuery("#elastic");
var innerDoc = (helpFrame.get(0).contentDocument) ? helpFrame.get(0).contentDocument : helpFrame.get(0).contentWindow.document;
helpFrame.height(innerDoc.body.scrollHeight + 35);
}
It doesn’t seem to work in Internet Explorer, though! The iframe source is on the same server, so that shouldn’t be the problem. Any idea what’s wrong? The iframe ID is #elastic. I’ve tested this in Firefox, Chrome, and Safari, and it works in all three of them just like it’s supposed to.
EDIT
I decided to just replace the script with another, more hefty jQuery solution. While it’s not as lightweight as I was hoping, it appears to work.
I managed to get it working by simply replacing my solution with this larger jQuery solution. Though bigger, it works like a charm!
http://sonspring.com/journal/jquery-iframe-sizing