本文主要是介绍用Iframe实现摸拟屏蔽,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<html>
<head>
<title>无忧脚本代码测试网页</title>
</head>
<body style="margin: 0px;" >
<br>
<INPUT value=Text>
<SELECT style="WIDTH: 134px" name=""> <OPTION value=下拉选择框
selected>下拉选择框</OPTION><OPTION value=下拉选择框1>下拉选择框1</OPTION></SELECT>
<button onclick="demo()">DialogClass</button>
<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11v
<br>11<br>11<br>11<br>11<br>11<br>11<br>11
<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11
<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11v
<br>11<br>11<br>11<br>11<br>11<br>11<br>11
<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11<br>11
<script>
var dialog = new DialogClass();
function demo()
{
dialog.show();
//解决楼下老兄提的问题
window.focus();
//5秒以后关闭:dialog.close();
setTimeout("dialog.close()",5000);
}
/**
* 类 名 称: DialogClass
* 功能说明: 禁止页面点击类
* 版权信息: CopyRight 2005-2006 JoeCom
* 创 建 人: JoeCom | MSN:juwuyi@hotmail.com | blog:http://hi.baidu.com/joecom
* 创建日期: 2006-07-21
* 修 改 人:
* 修改日期:
*/
function DialogClass(){
this.blankImgHandle = null;
this.tags = new Array("applet", "iframe", "select","object","embed");
this.body_overflow_y = null;
this.body_overflow_x = null;
this.show = function()
{
this.body_overflow_y = document.body.style.overflowY;
this.body_overflow_x = document.body.style.overflowX;
document.body.style.overflowX = "hidden";
document.body.style.overflowY = "hidden";
var w = "100%" ;
var h = "100%" ;
this.blankImgHandle = document.createElement("iframe");
with (this.blankImgHandle.style){
position = "absolute";
left = 0;
top = document.body.scrollTop;
height = "100%";
width = "100%";
zIndex = "9999";
filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=10)";
opacity = "0.1";
}
document.body.appendChild(this.blankImgHandle);
}
this.close = function(){
document.body.style.overflowY = this.body_overflow_y;
document.body.style.overflowX = this.body_overflow_x;
if (this.blankImgHandle)
{
this.blankImgHandle.parentNode.removeChild(this.blankImgHandle);
}
}
}
</script>
</body>
</html>
这篇关于用Iframe实现摸拟屏蔽的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!