<table id="Table1" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
<tr>
<td id="frmTitle" vAlign="middle" noWrap align="center"><iframe id="carnoc" style="Z-INDEX: 2; VISIBILITY: inherit; WIDTH: 140px; HEIGHT: 100%"
name="carnoc" src="LeftFrame.aspx" frameBorder="0" scrolling="no"> </iframe>
</td>

<td style="WIDTH: 100%"><iframe id="mainFrame" style="Z-INDEX: 1; VISIBILITY: inherit; WIDTH: 100%; HEIGHT: 100%"
name="mainFrame" src="MainFrame.aspx" frameBorder="0" scrolling="yes"></iframe>
</td>
</tr>
</table>这是Index.aspx页面 是个左右结构的框架页面 我想在左边框架点击完确定以后 动态的根据窗口的大小来获取右边框架的具体大小 请问该如何解决?谢谢

解决方案 »

  1.   

    在父窗口中代码
    <script language="javascript">
    function doShow(){
    //获得子页面的高度
    document.getElementById("content").contentWindow.document.body.scrollHeight
    //改变iframe的高度
    document.getElementById("content").style.height = document.getElementById("content").contentWindow.document.body.scrollHeight + "px";
    }
    </script>
    <body onload="doShow()">
    </body>
      

  2.   

    应该用docuemnt.body.offsetHeight
    docuemnt.body.offsetWidth
    来获取高度和长度
      

  3.   

    <table id="Table1" height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
    <tr>
    <td id="frmTitle" vAlign="middle" noWrap align="center"><iframe id="carnoc" style="Z-INDEX: 2; VISIBILITY: inherit; WIDTH: 140px; HEIGHT: 100%"
    name="carnoc" src="LeftFrame.aspx" frameBorder="0" scrolling="no"> </iframe>
    </td><td style="WIDTH: 100%"><iframe id="mainFrame" name="mainFrame" src="MainFrame.aspx" frameBorder="0" scrolling="no" onload="this.height=mainFrame.document.body.scrollHeight"></iframe>
    </td>
    </tr>
    </table>