Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将iFrame隐藏在面板/Div对象下_Javascript_Asp.net_Css - Fatal编程技术网

Javascript 将iFrame隐藏在面板/Div对象下

Javascript 将iFrame隐藏在面板/Div对象下,javascript,asp.net,css,Javascript,Asp.net,Css,正如您在我的图片中看到的,我有Pdf(在iFrame中)和Jquery滑动菜单(在Div/面板中)以及另一个iFrame。。我想隐藏滑动菜单iFrame(之所以在iFrame下添加面板,是因为作为pdf查看器的行为面板将隐藏在pdf下,并且在表单上不可见)。为此,我尝试设置display attribute=none;这不起作用:(有没有办法隐藏iFrame,但面板应该在它的位置 使用firebug检测是否在watch表达式中获取元素。您应该像这样访问iFrame <form name="

正如您在我的图片中看到的,我有Pdf(在iFrame中)和Jquery滑动菜单(在Div/面板中)以及另一个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') )

函数iframeRef(frameRef){
返回frameRef.contentWindow?frameRef.contentWindow.document:frameRef.contentDocument
}
var inside=iframeRef(document.getElementById('one'))

Hello Mayank Pathak..我想你不明白我的问题我说的是我想隐藏菜单控制面板下面的iFrame…那么我该怎么做..请参见上面的代码..您在内部变量中获得了iFrame..不在该变量上应用属性来隐藏iFrame..您的问题不是特别清楚,但从何而来我想你是在说:当你使iFrame不可见时,你想让“菜单”iFrame中显示的HTML保持可见?你能证实这一点,或者试着把你的问题弄清楚吗?那么,当你说东西在iFrame下时,你会感到困惑——我想你的意思是它们在iFrame中(请记住,iframe只是一个容器,用于显示单独的HTML文档、PDF文件等)?