隐藏面板/ Div对象下的iFrame [英] Hide the iFrame Under Panel / Div Object

查看:240
本文介绍了隐藏面板/ Div对象下的iFrame的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如你可以看到在我的形象我有Pdf(这是在iFrame)以及一个Jquery滑动菜单(这是在Div /面板)与另一个iFrame ..我想要隐藏滑动菜单iFrame添加Panel的原因在iframe下,因为pdf查看器行为面板将隐藏在Pdf下,并且不会在表单上可见)。为此,我试图设置display attribute = none;不工作:(有任何方法隐藏iFrame,但面板应该在它的位置。

As you can see in my image I have Pdf (Which is in the iFrame) along with a Jquery Sliding Menu (Which is in the Div/Panel) along with another iFrame.. I want to hide Sliding Menu iFrame (The reason for adding Panel Under iframe because as pdf viewer behaviour panel will hide itself under Pdf and will not be visible on the form). For that I tried setting display attribute = none; which not worked :( Is there any way to hide the iFrame but the Panel should be at its place.

推荐答案

使用firebug检测您是否元素在观察表达式或不。你应该像这样访问iFrame

Use firebug to detect if you are getting element in watch expression or not..you should access iFrame like this

<form name="formname" .... id="form-first">
<iframe id="one" src="iframe2.html">
</iframe>
</form>


function iframeRef( frameRef ) {
return frameRef.contentWindow ? frameRef.contentWindow.document : frameRef.contentDocument
}

var inside = iframeRef( document.getElementById('one') )

这篇关于隐藏面板/ Div对象下的iFrame的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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