javascript - 在 Panel/Div 对象下隐藏 iFrame

标签 javascript asp.net css

正如您在我的图像中看到的那样,我有 Pdf(位于 iFrame 中)以及 Jquery 滑动菜单(位于 Div/Panel 中)以及另一个 iFrame。我想隐藏滑动菜单 iFrame(在 iframe 下添加面板的原因是因为 pdf 查看器行为面板将自身隐藏在 Pdf 下并且在表单上不可见)。为此,我尝试设置 display attribute = none;这不起作用:(有没有办法隐藏 iFrame 但面板应该在它的位置。

enter image description here

最佳答案

使用 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/

相关文章:

javascript - 如何减少if的数量

javascript - 让我的 JQuery 与 IE 配合使用

asp.net - 非 root 用户的 Kestrel 权限被拒绝

c# - Request.ServerVariables ["LOGON_USER"] 与 Request.LogonUserIdentity

css - 在 Bootstrap 4 中添加多个类的正确方法是什么?

jquery - Bootstrap 工具提示显示在页面左上角

JavaScript 布局管理器?

javascript - REACT - 如果特定输入字段为空,我该如何发出警告?

c# - 如何遍历表行

jquery - 我怎样才能使 2 个垂直选项卡(左和右)在中心的相同内容框上工作>