六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 60|回复: 0

js实现 load mask

[复制链接]

升级  26.33%

83

主题

83

主题

83

主题

举人

Rank: 3Rank: 3

积分
279
 楼主| 发表于 2013-2-7 15:58:42 | 显示全部楼层 |阅读模式
<html>
<head>
<style type="text/css">
#mask {
    position: absolute;
    visibility:  hidden;
    background: #000;
    z-index: 99999;
    left: 0px;
    top: 0px;
    filter: alpha(opacity=80);
    text-align: center;
}
</style>
<script type="text/javascript">
var o;
function showMask() {
    o = document.getElementById("mask");
    o.style.visibility = "visible";
    o.style.height = window.screen.availHeight;
    o.style.width = window.screen.availWidth;
    
   o.style.zIndex = 10000;
    o.style.display = 'block';  
  o.style.position = 'absolute';  
    o.style.filter = "alpha(opacity:50)";  
   o.style.KHTMLOpacity = 0.5;  
    o.style.MozOpacity = 0.5;  
  o.style.opacity = 0.5;   
    o.style.background = '#ccc'; 

}
function closeMask() {
    o = document.getElementById("mask");
    o.style.visibility = "hidden";
}
</script>
</head>
<body>
<div id="mask" style="padding-top:20%" ><input type="button" value="close"  />
Loading...
</div>
<input type="button" value="showMask"  />
</body>
</html>
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表