如何禁用iframe [英] How to disable IFrame

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

问题描述



我无法禁用显示网站的IFrame.我用过

Hi,

I am unable to disable a IFrame showing a website. I have used

document.getElementById("iFrameID").Disabled = true;


在JavaScript中,但不能正常工作.我的页面上有三个iframe,用于显示另一个网站的实时警报状态.我不希望用户单击所有iframe的src页面中可用的任何链接.请帮助这非常紧急.

问候,
Atif


in javascript but it is not working. I have three iframes on my page showing the status of live alarms from another website. i do not want users to click any of links available in the src pages of all iframes. Please help it is very urgent.

Regards,
Atif

推荐答案

我不认为可以将其禁用.如果可能的话,它将如何呈现内容?禁用适用于控件.

如果需要,请考虑将其隐藏.

这是如何使用可见性属性来实现的:
http://www.w3schools.com/jsref/prop_style_visibility.asp [ http://api.jquery.com/hide/ [ http://api.jquery.com/show/ [ http://api.jquery.com/toggle/ [ http://en.wikipedia.org/wiki/JQuery [ http://docs.jquery.com/Tutorials:How_jQuery_Works [ http://docs.jquery.com/Tutorials [ http://docs.jquery.com/Main_Page [
I don''t think it can be disabled. How it would render the content if it was possible? Disabling is applicable to controls.

If you want, consider hiding it.

This is how can you do it with visibility attribute:
http://www.w3schools.com/jsref/prop_style_visibility.asp[^].

And this is how you can do it with jQuery (highly recommended):
hide: http://api.jquery.com/hide/[^],
show: http://api.jquery.com/show/[^],
toggle: http://api.jquery.com/toggle/[^].

If you need to learn jQuery, please see:
http://en.wikipedia.org/wiki/JQuery[^],
http://docs.jquery.com/Tutorials:How_jQuery_Works[^],
http://docs.jquery.com/Tutorials[^],
http://docs.jquery.com/Main_Page[^].

—SA


这里是一个主意:在IFrame上方放置一些东西,以拦截用户输入

样式zIndex属性 [ event.stopPropagation() [
Here is an idea: Place something above your IFrame that intercepts user input

Style zIndex Property[^]

This might help:
event.stopPropagation()[^]

Best regards
Espen Harlinn


hii,
请参考这个
http://www.idevspot.com/idev-blog/how-to-make-an-iframe-read-only-disable-mouse-click-in-iframe.html [
hii,
please refer this,
http://www.idevspot.com/idev-blog/how-to-make-an-iframe-read-only-disable-mouse-click-in-iframe.html[^]


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

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