实现弹出一个全屏灰黑色透明遮罩效果
2014-05-06 00:23
513 查看
<!DOCTYPE html> <html> <head> <meta charset=" utf-8"> <meta name="author" content="http://www.softwhy.com/" /> <title>CSS如何实现弹出一个全屏灰黑色透明遮罩效果-蚂蚁部落</title> <style type="text/css"> *{ margin:0px; padding:0px; } .zhezhao{ width:100%; height:100%; background-color:#000; filter:alpha(opacity=50); -moz-opacity:0.5; opacity:0.5; position:absolute; left:0px; top:0px; display:none; z-index:1000; } .login{ width:280px; height:180px; position:absolute; top:200px; left:50%; background-color:#000; margin-left:-140px; display:none; z-index:1500; } .content{ margin-top:50px; color:red; line-height:200px; height:200px; text-align:center; } </style> <script type="text/javascript"> window.onload=function(){ var zhezhao=document.getElementById("zhezhao"); var login=document.getElementById("login"); var bt=document.getElementById("bt"); var btclose=document.getElementById("btclose"); bt.onclick=function(){ zhezhao.style.display="block"; login.style.display="block"; } btclose.onclick=function(){ zhezhao.style.display="none"; login.style.display="none"; } } </script> </head> <body> <div class="zhezhao" id="zhezhao"></div> <div class="login" id="login"><button id="btclose">点击关闭</button></div> <div class="content">蚂蚁部落欢迎您,<button id="bt">点击弹出遮罩</button></div> </body> </html>
本文出处:http://www.softwhy.com/forum.php?mod=viewthread&tid=6377
相关文章推荐
- JS+CSS实现弹出全屏灰黑色透明遮罩效果的方法
- JS+CSS实现弹出全屏灰黑色透明遮罩效果的方法
- 基于JavaScript实现全屏透明遮罩div层锁屏效果
- 基于JavaScript实现全屏透明遮罩div层锁屏效果
- 弹出遮罩层后禁止滚动效果【实现代码】
- js写一个弹出层并锁屏效果实现代码
- html+css源码之实现登录弹出框遮罩层效果
- 一个不错的可拖动层遮罩加ALPHA滤镜(点击弹出后背景变浅色,信息提示框效果)
- Android初学习 - 分别以Java code和XML两种方式给FrameLayout布局的Activity增加一个遮罩效果的实现
- activity全屏实现沉浸式效果,并且单独触摸不会弹出虚拟按键
- jQuery实现一个弹出登陆层的效果
- html+css源码之实现登录弹出框遮罩层效果
- 一个不错的可拖动层遮罩加ALPHA滤镜(点击弹出后背景变浅色,信息提示框效果)
- 在andriod里实现透明遮罩效果
- iOS 用UIWindow实现一个悬浮按钮或者全屏覆盖效果
- 弹出遮罩层后禁止滚动效果【实现代码】
- 一个不错的可拖动层遮罩加ALPHA滤镜(点击弹出后背景变浅色,信息提示框效果)
- 用html5 js实现点击一个按钮达到浏览器全屏效果
- easyui实现鼠标移到某一行,就会弹出一个提示信息效果
- jQuery实现点击弹出背景变暗遮罩效果实例代码