<input onclick="test()" type=button value="改尺寸"><br>
<iframe id=mxh src="http://sohu.com"></iframe>
<script>
function test()
{
document.all.mxh.style.height='500'
document.all.mxh.style.width='780'
}
</script>

解决方案 »

  1.   

    试验一下:
    在子页面里用<body onload="self.resizeTo(780,500)">看看,我没有试验
      

  2.   

    那么能得到iframe所饱含的叶面的文档总高度吗?就是想让iframe永远不出现滚动条,正好显示叶面的全部内容。
      

  3.   

    可以的:
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE></TITLE>
    </HEAD>
    <BODY onload="test()">
    <script>
    function test()
    {
    window.resizeTo(document.body.clientWidth,document.body.clientHeight)
    alert("ff")
    }
    </script></BODY>
    </HTML>
      

  4.   

    用法:http://xxx.com/test.htm文件如下:
    ================================
    <iframe id=mxh src="http://joyroot/Resources/s.htm"></iframe>http://joyroot/Resources/s.htm文件如下:
    ==========================================
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE></TITLE>
    </HEAD>
    <BODY onload="test()">
    <script>
    function test()
    {
    window.resizeTo(document.body.clientWidth + 20,document.body.clientHeight + 20)}
    </script>
    <p>test<p>test<p>test<p>test<p>test<p>test<p>test<p>test<p>test<p>test<p>test<p>test</BODY>
    </HTML>
      

  5.   

    sorry:应该是 :
    <BODY onload="test()">
    <script>
    function test()
    {
    window.resizeTo(document.body.scrollWidth+20,document.body.scrollHeight+20)
    }
    </script>