为两个iframe创建常用卷轴

时间:2014-07-18 05:52:52

标签: javascript jquery html css

我想要创建的是两个滚动条,一个垂直和水平,当我滚动其中任何一个时,两个文档将同时滚动。

我虽然给了“divMain”“overflow:auto”属性和溢出:隐藏到其他控件的其余部分。但是,当我运行时,有iframe的滚动条。滚动条属于iframe中具有id xxxx的div。

我不知道div来自哪里。可能是我所展示的文档中的内容,这是一份infopath报告。

我给了父div maxheight(由于分辨率问题我觉得很好),现在滚动来了高度。

现在我希望滚动主div滚动

时滚动子控件(iframe)内容

HTML:

<div id="divMain">
    <div id="divChildOne" style="float: left; width: 50%;">
        <asp:Label runat="server" ID="lableOne" Font-Bold="true"></asp:Label>
        <br />
        <iframe id="iFrameOne" runat="server" style="width:100%;" />
    </div>
    <div id="divChildTwo" style="float: right; width: 50%;">
        <asp:Label runat="server" ID="labelTwo" Font-Bold="true"></asp:Label>
        <br />
        <iframe id="iFrameTwo" runat="server" style="width:100%;" />
    </div>
</div>

由于

1 个答案:

答案 0 :(得分:0)

 <div id="FieldCustom" runat="server" style="width:450px; height:400px; overflow:scroll;">

                <div id="divMain">
    <div id="divChildOne" style="float: left; width: 50%;">
        <asp:Label runat="server" ID="lableOne" Font-Bold="true"></asp:Label>
        <br />
        <iframe id="iFrameOne" runat="server" style="width:100%;" />
    </div>
    <div id="divChildTwo" style="float: right; width: 50%;">
        <asp:Label runat="server" ID="labelTwo" Font-Bold="true"></asp:Label>
        <br />
        <iframe id="iFrameTwo" runat="server" style="width:100%;" />
    </div>
</div>



                </div>
相关问题