遮罩层整理

来源:互联网 发布:淘宝 买家手机号 编辑:程序博客网 时间:2024/06/05 02:20

css部分:

#bg{ display: none;  position: absolute;  top: 0%;  left: 0%;  width: 100%;  height: 100%;  background-color: black;  z-index:1001; -moz-opacity: 0.7;  opacity:.70;  filter: alpha(opacity=70);}#show{display: none;  position: absolute;  top: 25%;  left: 22%;     width: 680px;  height: 380px;  padding: 8px;  border: 8px solid #E8E9F7;     background-color: white;  z-index:1002;  overflow: auto;}

js部分:

//遮罩层function showdiv() {   document.getElementById("bg").style.display ="block";            document.getElementById("show").style.display ="block";//$("#bg").css("display","block");//$("#show").css("display","block");        }function hidediv() {document.getElementById("bg").style.display ='none';            document.getElementById("show").style.display ='none';//$("#bg").css("display","none");//$("#show").css("display","none");        }


html部分:

<!-- 遮罩层 --> <div id="bg"></div> <div id="show" class="alert alert-success" role="alert"> </div>



0 0