a.htm 框架页 
<script language="javascript">
            //iframe的高度随内容自动增大,而不产生下拉滚动条。
            function autoResize1() {
            try {
            document.all["mainFrame"].style.height=mainFrame.document.body.scrollHeight;
            }catch(e){}
            }
        </script>
      <IFRAME align="top" frameBorder=0 id="mainFrame" name="mainFrame" scrolling=no src="b.htm" style="height:expression(1); aho:expression(autoResize1()); width:100%;" marginWidth=0 marginHeight=0> </IFRAME>
  
  b.htm 嵌入页(宽度和高度都超过屏幕显示区域)
<table width="2000" border="1">
  <tr>
    <td height="200">3</td>
    <td height="200">eee</td>
    <td height="200">&nbsp;</td>
  </tr>
  <tr>
    <td height="200">3</td>
    <td height="200">e</td>
    <td height="200">&nbsp;</td>
  </tr>
 
  <tr>
    <td height="200">5</td>
    <td height="200">&nbsp;</td>
    <td height="200">&nbsp;</td>
  </tr>
  <tr>
    <td height="200">5</td>
    <td height="200">&nbsp;</td>
    <td height="200">&nbsp;</td>
  </tr>
  <tr>
    <td height="200">5</td>
    <td height="200">&nbsp;</td>
    <td height="200">&nbsp;</td>
  </tr>
</table>问题是不想通过IFRAME滚动条来控制IFRAME,想通过a.htm的滚动条来控制IFRAME显示b.htm的内容!
纵向控制效果已经达到,就是横向没有滚动条无法控制啊?
a.htm的代码改为以下内容,也不管用,还请高手指点!谢了!
<script language="javascript">
            //iframe的高度随内容自动增大,而不产生下拉滚动条。
            function autoResize1() {
            try {
            document.all["mainFrame"].style.height=mainFrame.document.body.scrollHeight;
            }catch(e){}
            }
        </script>
<script language="javascript">
            //iframe的宽度随内容自动增大,而不产生下拉滚动条。
            function autoResize2() {
            try {
            document.all["mainFrame"].style.width=mainFrame.document.body.scrollwidth;
            }catch(e){}
            }
        </script>      <IFRAME align="top" frameBorder=0 id="mainFrame" name="mainFrame" scrolling=no src="b.htm" style="height:expression(1); aho:expression(autoResize1()); width:expression(1); aho:expression(autoResize2());" marginWidth=0 marginHeight=0> </IFRAME>

解决方案 »

  1.   

    你这样还不能兼容firefox可以参考:
    if(document.getElementById("comment1").Document && document.getElementById("comment1").Document.body.scrollHeight){
    document.getElementById("commentdiv").style.height = document.getElementById("comment1").Document.body.scrollHeight + "px";
    }else{
    document.getElementById("commentdiv").style.height = document.getElementById("comment1").contentDocument.body.offsetHeight + "px";
    }