用offsetHeight,offsetWidth属性计算出页面内控件所占的空间,然后将该空间的长、宽值赋给iframe

解决方案 »

  1.   

    onload="javascript:if(screen.height>130)this.height=130" 把它放进<iframe>里
      

  2.   

    在iframe所显示的页面中加
    <body onload="javascript:parent.document.all.ifrm.height=document.body.scrollHeight;">
      

  3.   

    在被 iframe 包含的网页里加入如下代码: 
    注意父网页的 iframe 的 name 不能为空!function parentIframeHeight()
    {
      if(top!=self && self.name!="")
      {
        var e;
        /*@cc_on @*/ /*@if (@_jscript_version>=3) e = window.parent.document.all(self.name); @else @*/
          if(window.navigator.appName=="Netscape" && parseInt(window.navigator.appVersion)>5)
            e = window.parent.document.getElementById(self.name);
          else e = eval("window.parent."+ self.name);
        /*@end @*/
        var n = (document.body.style.overflow == "hidden") ? 0 : 16;
        e.height = parseInt(document.body.scrollHeight + n, 10);
      } 
    }
    window.attachEvent("onload", parentIframeHeight);