hello everyone,
I have an iframe, which I need to resize automatically to fit its content. After a lot of searching, I found a javascript snippet that seemed to suit my needs (from [url]http://www.ozoneasylum.com/9671
[CODE]
<script language = “javascript”>
function setCorrectIframeSize()
{
resizeIframe(‘myFrameID’);
}
function resizeIframe(id) {
frame = window.document.getElementById(id);
innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
objToResize = (frame.style) ? frame.style : frame;
objToResize.height = innerDoc.body.scrollHeight+’px’;
}
</script>
<input type = “button” value = “resize” onclick = “setCorrectIframeSize();”/>
<iframe width = “100%” name = “myFrameName” id = “myFrameID” src = “readme.html” ></iframe>
The problem is that the script really works fine, in both IE and Mozilla, except in one case: When the iframe target file “readme.html” has many lines, (more than about 1500), mozilla fails to render correctly the iframe content after resizing (its last 100+ lines seem to repeat themselves). the readme.html contents don’t make any difference, I’ve tried it with many other files (or even plain characters in its source)…
Any ideas would be *very