如何把div的iframe按钮带到前面 [英] How to bring iframe button front of div

查看:189
本文介绍了如何把div的iframe按钮带到前面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有两个页面,一个是主页面,另一个是重新连接页面。我已使用iframe在主页面中添加了重新连接页面。重新连接页面有一个按钮。在主页面中,我在iframe上放置了一个div。但是我需要在div上带上重新连接按钮(仅限)。



我尝试了什么:



重新连接页面:



< div> 
< p>重新连接页面< / p>
< asp:Button ID =reconnectButtonrunat =serverText =Reconnect/> //按钮需要前面的overlappedDiv
< / div>







主页:



< div style =height:300px; width:300px;> 
< iframe id =reconnectPageFramerunat =serversrc =ReconnectPage.aspxstyle =Height:100%; width:100%; float:left>< / iframe>
< div id =OverlappedDivstyle =height:300px; width:100%; margin-removed-300px; float:left; />
< / div>

解决方案

你不能。 < iframe> 是一个不可分割的单位。您只能控制整个< iframe> 的z-index;您不能将包含文档中的元素与包含文档中的元素混合在一起。



您需要修改 ReconnectPage。 aspx 页面,以便它只包含您要显示的按钮,或将按钮移动到主页面并在那里复制功能。


尝试设置以下内容在你想要带到前面的按钮上:



 style =position:absolute; z-index:10000; top:50 %;左; 50%


Hi,
I have two pages, one is main page and another one is reconnect page. I have added the reconnect page in main page using iframe. the reconnect page has a button. In the main page i placed a div on the iframe. But i need to bring the reconnect button(only) on the div.

What I have tried:

Reconnect Page:

<div>
    <p> Reconnect the page </p>
    <asp:Button ID="reconnectButton" runat="server" Text="Reconnect"/>// button needs to be get front of "overlappedDiv"
</div>




Main Page:

 <div style="height:300px;width:300px;">
     <iframe id="reconnectPageFrame"  runat="server" src="ReconnectPage.aspx" style="Height:100%;width:100%;float:left"></iframe>
     <div id="OverlappedDiv" style="height:300px;width:100%;margin-removed-300px;float:left;" />
</div>

解决方案

You can't. The <iframe> is a single indivisible unit. You can only control the z-index of the entire <iframe>; you can't have elements from the contained document intermingled with elements from the containing document.

You'll either need to modify the ReconnectPage.aspx page so that it only contains the button you want to display, or move the button into the main page and replicate the functionality there.


Try setting the following on the button you want to bring to front:

style="position:absolute;z-index:10000;top:50%;left;50%"


这篇关于如何把div的iframe按钮带到前面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆