<!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>
<style>
body{margin:0;padding:0;}
#topFill{display:none;text-align:center;position:absolute;z-index = 999;filter:alpha(opacity=50);background-color:#eee;opacity: 0.5;-moz-opacity: 0.5;width:100%;}
#alertBox{margin:auto;height:150px;width:300px;background-color:#cf0;text-align:left;border:1px solid #666}
#alertTitle{height:20px;background-color:#EDF8B8;line-height:20px;padding:0 10px;border-bottom:1px solid #71860D}
#alertContent{padding:42px 0;;text-align:center;}
#alertBtn{text-align:center;}
#alertBtn input{margin:0 10px;background:#FFFF99;border:1px solid #fff;height:20px;line-height:20px;}
</style>
<script type="text/javascript" >
//document.documentElement.clientHeight+'px'
// onload的时候声明对象
var obj = new Object;
function oload(){
obj = document.getElementById('topFill');
obj.style.display = 'none';
}
function cl(){
document.body.style.overflow = 'hidden';
document.body.style.height = document.documentElement.clientHeight + 'px';
obj.style.display = 'block';
obj.style.height = document.documentElement.clientHeight + 'px';
}
function bcl(){
document.body.style.overflow = '';
obj.style.display = 'none';
}
function oresize(){
if(obj.style.display != 'block'){
}else{
cl();
}
}
function isno(str){
if (str == 'yes'){
window.close();
}else {
bcl();
}
}
</script>
</head>
<body onload="oload()" onresize="oresize()">
<div id="topFill">
<div id="alertBox">
<div id="alertTitle">警告!</div>
<div id="alertContent">你确定要退出吗?</div>
<div id="alertBtn"><input type="button" value="是(Y)" onclick="isno('yes')" /><input type="button" value="否(N)" onclick="isno('no')" /></div>
</div>
</div>
<input type="button" value="点我" onclick="cl()"/>
</body>
</html>
分享到:
相关推荐
flash 渐隐遮罩实现 需要用都“位图缓存” 在本实例中实现了as控制的缓存设置与遮罩控制 适合于初学
用JavaScript实现的网页遮罩效果,使用了单例保障只创建唯一的遮罩,运用了JavaScript面向对象编程
JavaScript图片展示遮罩特效,悬空浮动,鼠标移动到图片,打开遮罩层,移开则重新遮罩。可用来制作迷宫或者选图片答题等游戏。
点击用户登陆弹出对话框并遮罩背景 拖动滚动条两个层位置变化(如果不使用该段代码,当用户拖动滚动条遮罩层不能覆盖整个页面,对话框层也不能位于页面中间)
就一个html文件,代码也很少,没有用Jquery。JS遮罩效果 遮罩效果 弹出登录层JS遮罩效果 遮罩效果 弹出登录层
遮罩效果10种
易语言八方向拖动遮罩效果源码,八方向拖动遮罩效果,组件_外形框移动,组件_外形框显示,位图_亮度调节
NULL 博文链接:https://penghuaiyi.iteye.com/blog/1172592
白色遮罩层渐清晰效果flash文件 白色遮罩层渐清晰效果flash文件 白色遮罩层渐清晰效果flash文件
几种漂亮的html遮罩效果
利用C#生成一种遮罩图像效果,图像被一个遮罩层挡住,然后由两边向中间显示,最终显示出图像,主要功能是为显示图像增加动态效果,避免单调死板,也希望通过这个小例子,让大家明白一些C#有关的图像遮罩效果。
最近在做新手指导相关的东西,需要用到遮罩的效果,就查找资料整理了一个遮罩效果,自己测试正常后在游戏中正常使用中
javascript 弹出遮罩层,弹出半透明的遮罩层并显示注册文本框内容,让网页更生动
HTML5+CSS3 制作的图片半透明遮罩效果
JQuery鼠标悬停向上滑出遮罩效果是一款多个图片列表排列后,鼠标悬停在其中一个图片上后,显示标题以及图片文字介绍效果。
弹出一个层,屏蔽网页,解决window.open被阻止产问题
从网上下载的遮罩层,自己修改了一下 通过链接即可调用:<a href="javascript:openMiddlelDiv('ModuleEdit.aspx','新建模块');">新建功能模块</a>
参考链接:https://blog.csdn.net/caoshangpa/article/details/53053409
在winform中实现的遮罩层效果
html遮罩效果样式,html静态页,CSS样式控制遮罩效果