页面Default.aspx里面包含三个iframe
<body>
    <form id="form1" runat="server">
    <div>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
                <td>
                    <iframe runat="server" id="TopIframe" height="115" src="Top.aspx" scrolling="no" width="774" frameborder="0"></iframe>
                </td>
            </tr>
            <tr>
                <td>
                    <iframe runat="server" id="MiddleIframe" src="Middle.aspx" scrolling="no" width="774" frameborder="0"></iframe>
                </td>
            </tr>
            <tr>
                <td>
                    <iframe id="BottomIframe" src="Bottom.aspx" width="100%" scrolling="no" frameborder="0"></iframe>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
页面Middle.aspx里面又包含有frameset,外面一个frameset是用来做自动高度的,里面一个是真正包含内容的
<noframes>您的浏览器不支持框架</noframes>
<frameset id="LayoutFrameset" rows="0,*" frameborder="0" framespacing="0">
    <frame id="LayoutTop" src="#" noresize="noresize" />
    <frameset id="pMainFrameset" frameborder="0" framespacing="0" cols="158,616">
        <frame id="pleft" name="pleft" scrolling="no" noresize="noresize" src="Left.aspx?wNO=<%=WebNO()%>" />
        <frame id="pmain" name="pmain" scrolling="no" noresize="noresize" src="Main.aspx?wNO=<%=WebNO()%>" allowtransparency="true" runat="server" />
    </frameset>
</frameset>
在Main.aspx页面我已经搞定了高度的自动变化
<script type="text/javascript">
    window.onload=function()
    {
        if(window.document.body.scrollHeight<680)
        {
            window.parent.document.all("LayoutFrameset").rows="0,680";
            window.parent.parent.document.all('MiddleIframe').height=680;
        }
        else
        {
            window.parent.document.all("LayoutFrameset").rows="0,"+window.document.body.scrollHeight;
            window.parent.parent.document.all('MiddleIframe').height=window.document.body.scrollHeight;
        }
    }
</script>
我的问题是:在Default.aspx页里面在iframe外面才可以使用滚轮控制滚动条,而鼠标移动到iframe里面的frameset里面的无论是left.aspx或者Main.aspx页的时候,不管怎么滚动滚轮,滚动条都不动,让人非常难过,一定要把鼠标移动到iframe(frameset)外面来才起作用,感觉很不爽。是否有个方法可以设置一个所谓的全局鼠标或者叫全局滚动来解决这一问题。请高人指点。

解决方案 »

  1.   

    <html>
    <head>
    </head>
    <body>
    <div id="div1" style="width:100; height:100; overflow:scroll" onscroll="funcsrcoll()">
    <iframe src="tt.htm" scrolling="no"></iframe>
    </div>
    <div id="div2" style="width:100; height:100; overflow:scroll">
    <iframe src="tt.htm" scrolling="no"></iframe>
    </div>
    </body>
    </html>
    <script language="JavaScript" type="text/JavaScript">
    function funcsrcoll()
    {
     div2.scrollLeft = div1.scrollLeft;
     div2.scrollTop = div1.scrollTop;
    }
    </script>
      

  2.   

    天啊,怎么在IE里面又不行,在遨游里面可以。。怎么办。。 属性“onscroll”不是元素“div”的有效属性