<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<iframe name="myfr" onload="this.style.height=frames.myfr.document.documentElement.scrollHeight+'px'" ...></iframe>
</body>

解决方案 »

  1.   

    onload="this.style.height=frames.myfr.document.documentElement.scrollHeight+'px'"这个加进去也没用啊 ff下
      

  2.   

    你这段代码
    function reinitIframe(){
    var iframe = document.getElementById("hj");
    try{
    var bHeight = iframe.contentWindow.document.body.scrollHeight;
    var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
    var height = Math.max(bHeight, dHeight);
    iframe.height =  height;
    }catch (ex){}
    }
    window.setInterval("reinitIframe()", 200);是放哪?
      

  3.   

    <script src="js/pro.js"></script>
    pro.js 就是上面的内容
      

  4.   

    找到了
    <script language="Javascript">
    var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
    //extra height in px to add to iframe in FireFox 1.0+ browsers
    var FFextraHeight=getFFVersion>=0.1? 16 : 0function dyniframesize(iframename) {
    var pTar = null;
    if (document.getElementById){
    pTar = document.getElementById(iframename);
    }
    else{
    eval('pTar = ' + iframename + ';');
    }
    if (pTar && !window.opera){
    //begin resizing iframe
    pTar.style.display="block"if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
    //ns6 syntax
    pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight; 
    }
    else if (pTar.Document && pTar.Document.body.scrollHeight){
    //ie5+ syntax
    pTar.height = pTar.Document.body.scrollHeight;
    }
    }
    }
    </script>然后对于主页面用到iframe的地方添加代码:<iframe id="myTestFrameID" 
    onload="javascript:{dyniframesize('myTestFrameID');}" 
    marginwidth=0 marginheight=0 frameborder=0 
    scrolling=no src="/myiframesrc.php" 
    width=200 height=100></iframe>