JS仿 WINXP 注销桌面渐隐效果
2007-06-14 11:36
309 查看
<!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="text" id="textaaa" />
<input type="button" value="点我" onclick="cl()"/>
<h1>呵呵阿斗司法</h1>
<p>呵呵阿斗司法</p>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1><h1>呵呵阿斗司法</h1><h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h
4000
1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
</body>
</html>
页面里面总共有三个 按钮的 onclick 事件 和一个 body 的 onresize 事件
当点击 '点我' 那个按钮的时候. js就执行 cl 这个函数
[Copy to clipboard] [ - ]
CODE:
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';
}
这个函数的意义就是
我让 body 这个标签的 overflow 属性改为 ' hidden ' 很明显,就是让在body高度以外的 内容隐藏...嘿嘿......
下一行 的意思也就足够明显啦.. 让 body的高度 = 当前窗体的高度~~ 这样由于 body 的 overflow = 'hidden' 了..那么我给 body一个当前窗体的高度的化,那么 滚动条不就消失了吗??嘿嘿嘿...这样给我下一步的阴谋创造了条件哦.~~~
obj.style.display = 'block';这一句就是 让遮罩层显出来拉~~然后在给遮罩层一个高度,这个高度就是 窗体的高度~~这样的话..HOHO.......
这就让文档所有的内容 都盖到 遮罩层下面啦..~~~
然后 在给 body 的 onresize(当窗体大小改变时触发的事件) 一个函数 就是判断 遮罩层当前是否显示啊..如果显示的话就改遮罩层的大小等于当前窗体大小.否则什么都不执行...HOHO
到这里大家应该很清楚了吧
<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="text" id="textaaa" />
<input type="button" value="点我" onclick="cl()"/>
<h1>呵呵阿斗司法</h1>
<p>呵呵阿斗司法</p>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1><h1>呵呵阿斗司法</h1><h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h
4000
1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
<h1>呵呵阿斗司法</h1>
</body>
</html>
页面里面总共有三个 按钮的 onclick 事件 和一个 body 的 onresize 事件
当点击 '点我' 那个按钮的时候. js就执行 cl 这个函数
[Copy to clipboard] [ - ]
CODE:
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';
}
这个函数的意义就是
我让 body 这个标签的 overflow 属性改为 ' hidden ' 很明显,就是让在body高度以外的 内容隐藏...嘿嘿......
下一行 的意思也就足够明显啦.. 让 body的高度 = 当前窗体的高度~~ 这样由于 body 的 overflow = 'hidden' 了..那么我给 body一个当前窗体的高度的化,那么 滚动条不就消失了吗??嘿嘿嘿...这样给我下一步的阴谋创造了条件哦.~~~
obj.style.display = 'block';这一句就是 让遮罩层显出来拉~~然后在给遮罩层一个高度,这个高度就是 窗体的高度~~这样的话..HOHO.......
这就让文档所有的内容 都盖到 遮罩层下面啦..~~~
然后 在给 body 的 onresize(当窗体大小改变时触发的事件) 一个函数 就是判断 遮罩层当前是否显示啊..如果显示的话就改遮罩层的大小等于当前窗体大小.否则什么都不执行...HOHO
到这里大家应该很清楚了吧
相关文章推荐
- 有趣的思路~~JS仿 WINXP 注销桌面渐隐效果
- 有趣的思路~~JS仿 WINXP 注销桌面渐隐效果
- Js对角线收缩,渐隐文字效果
- 自写jquery网页回到顶部效果,渐隐图标,引用js文件即可
- 自写jquery网页回到顶部效果,渐隐图标,引用js文件就可以
- 自写jquery网页回到顶部效果,渐隐图标,引用js文件就可以
- js实现图片渐隐渐显的切换效果
- 非常惊艳的Css3的桌面上散落的相片效果,以及单击放大图片的LightBox效果(独立Js非jQuery)的实现原理
- Jquery教程:JS弹出窗口DIV层效果代码
- 用XML+FSO+JS实现服务器端文件的选择效果
- 利用JS实现动态进度条效果
- JS实现简单的浮动碰撞效果示例
- 原生js实现跑马灯抽奖效果
- js编写选项卡效果
- JS实现图片推拉门效果
- JS仿Android Toast提示效果
- JS自定义滚动条效果+鼠标滚轮事件
- JS 选项卡效果案例
- 实用js+css多级树形展开效果导航菜单
- JS回到顶部效果设计总结