屏蔽iframe中的超链接
来源:互联网 发布:淘宝托管公司排名杭州 编辑:程序博客网 时间:2024/05/13 18:31
在道州网daozhou.net网站设计时,碰到了一个问题,如何屏蔽iframe中的超链接?
经过摸索,屏蔽iframe中的超链接找到了一个办法,呵呵
步骤一:
新建一个文档,命名为A.html,代码如下
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<div style="width:800px;height:200px;position:absolute;filter:alpha(opacity=0);top:0;left:0;"></div>
<iframe style="margin-top:6px;float:left;" src="http://my.daozhou.net;" width="800px" height="200px" frameborder="0" scrolling="no" allowTransparency="true"/>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<div style="width:800px;height:200px;position:absolute;filter:alpha(opacity=0);top:0;left:0;"></div>
<iframe style="margin-top:6px;float:left;" src="http://my.daozhou.net;" width="800px" height="200px" frameborder="0" scrolling="no" allowTransparency="true"/>
</body>
</html>
步骤2二:
使用框架调用A.html文档:
<iframe width="800" height="200" src="a.html" frameborder="0" scrolling="no" allowTransparency="true"></iframe>
这样就顺利地实现了iframe无链接点击。
原理:在iframe上面覆盖一个DIV,DIV必须有背景色且透明。position为absolute,通过top和left属性控制该DIV的位置使之覆盖于iframe之上。这样iframe就被遮盖住,而里面的任何东西都点不了了。
- 屏蔽iframe中的超链接
- 导出报表时如何屏蔽单元格中的超链接
- iframe中的超链接跳转到包含该iframe的父窗口中
- 屏蔽超链接<a>跳转事件
- 在iframe里点击超链接
- 第一次做iframe中超链接总经
- Cross Domian iFrame Exceptions 跨域iFrame屏蔽例外
- PPT中的超链接
- ACCESS中的超链接
- 提取网页中的超链接
- 提取网页中的超链接
- GridView中的超链接
- GridView中的超链接
- 图象中的超链接
- GridView中的超链接
- GridView中的超链接
- GridView中的超链接 (收藏)
- GridView中的超链接
- py正则表达式1
- C#CS结构,控制输入数字的方法
- DNFS is
- 怎样才能算是设计优秀的PCB文件
- C#文件操作
- 屏蔽iframe中的超链接
- 设置Proxy Server和SQL Server实现数据库安全
- IIS运行一段时间不响应的解决方法
- 手机视频监控系统需求
- JNI使用—java使用C++dll及dll回调java
- http协议以及交互
- c++ 指针基础1
- javascript 判断字符是否为数字
- C#监测全局键盘与鼠标事件