Home  >  Article  >  Web Front-end  >  js mask effect to create pop-up registration interface effect

js mask effect to create pop-up registration interface effect

高洛峰
高洛峰Original
2017-02-03 17:37:101424browse

The example in this article shares the specific code of the js mask effect pop-up interface for your reference. The specific content is as follows

<head>
 <meta charset="UTF-8">
 <title>遮罩</title>
 <style>
  * {
   margin: 0;
   padding: 0;
  }
  #shade{
   position: fixed;
   width: 100%;
   height: 100%;
   display: none;
  }
  .shade-background{
   width: 100%;
   height: 100%;
   background-color: #CCCCCC;
   opacity: 0.5;
  }
  #register{
   position: relative;
   background-color: #fff;
   width: 500px;
   height: 300px;
   top: -70%;
   margin: 0 auto;
  }
 </style>
</head>
<body>
<div id="shade">
 <div class="shade-background"></div>
 <div id="register">
  用户名<input type="" name="" id="" value="" /><br />
  密 码<input type="" name="" id="" value="" /><br />
  <input type="submit" name="" id="reg" value="注册" />
 </div>
</div>
<div>
 <input type="button" name="" id="btn" value="弹出遮罩" />
</div>
</body>
<script>
 var shade = document.getElementById("shade");
 var btn = document.getElementById("btn");
 var reg = document.getElementById("reg");
 btn.onclick = function(){
  shade.style.display = "block"
 }
 reg.onclick = function(){
  shade.style.display = "none"
 }
</script>

Rendering:

js mask effect to create pop-up registration interface effect

The above is the entire content of this article. I hope it will be helpful to everyone's study. I also hope that everyone will support the PHP Chinese website.

For more js mask effect creation and pop-up registration interface effect related articles, please pay attention to the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn