bojomojo
12-07-2008, 04:30 PM
hello, I have this code to resize an iframe based on its content, but it works only with ie and not ff, any help?
<script type="text/javascript" language="javascript">
function resizeIframe(iframeID) {
if(self==parent) return false; /* Checks that page is in iframe. */
else if(document.getElementById&&document.all) /* Sniffs for IE5+.*/
var FramePageHeight = framePage.scrollHeight + 40; /* framePage is the ID of the framed page's BODY tag. The added 10 pixels prevent an unnecessary scrollbar. */
parent.document.getElementById(iframeID).style.height=FramePageHeight; /* "iframeID" is the ID of the inline frame in the parent page. */
}
</script>
then its loaded onload in thebody tag
<script type="text/javascript" language="javascript">
function resizeIframe(iframeID) {
if(self==parent) return false; /* Checks that page is in iframe. */
else if(document.getElementById&&document.all) /* Sniffs for IE5+.*/
var FramePageHeight = framePage.scrollHeight + 40; /* framePage is the ID of the framed page's BODY tag. The added 10 pixels prevent an unnecessary scrollbar. */
parent.document.getElementById(iframeID).style.height=FramePageHeight; /* "iframeID" is the ID of the inline frame in the parent page. */
}
</script>
then its loaded onload in thebody tag