正如您在我的图像中看到的那样,我有 Pdf(位于 iFrame 中)以及 Jquery 滑动菜单(位于 Div/Panel 中)以及另一个 iFrame。我想隐藏滑动菜单 iFrame(在 iframe 下添加面板的原因是因为 pdf 查看器行为面板将自身隐藏在 Pdf 下并且在表单上不可见)。为此,我尝试设置 display attribute = none;这不起作用:(有没有办法隐藏 iFrame 但面板应该在它的位置。
最佳答案
使用 firebug 来检测您是否在 watch 表达式中获取元素..您应该像这样访问 iFrame
<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') )
关于javascript - 在 Panel/Div 对象下隐藏 iFrame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11607893/