Summary of landing mask effects implemented by javascript

  • 2020-09-28 08:48:16
  • OfStack

Landing mask effect implemented by javascript


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> mask </title>
<style>
  #blanks{
    display:none;
    width:100%;
    //height:100%;
    height:100px;
    position:absolute;
    top:0;
    background-color:#ccc;
    z-index:1000;
    -moz-opacity: 0.7; 
    opacity:.70; 
    filter: alpha(opacity=70);
  }
  #login{
    padding:18px;
    display:none;
    background-color:pink;
    width:300px;
    height:100px;
    position:absolute;
    left:400px;
    top:20%;
    z-index:1001;
     
  }
</style>
</head>
<body onload="setHeight()">
   <div id="content">
      <input type="button" value=" landing " onclick="showLogin()">
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
      <p> Before Life 15 Years or so are teaching levels that are too weak to "skip". 
       As a 1 As a new comer, you have a lot of time and energy, but almost no experience. You'll find most of the elements of the game, 
       Like any great job, wealth, or partner that hasn't been unlocked, 1 Until you have them. 
       During this time, your skills are upgrading very quickly. In later games, you will never be like this again 1 I have plenty of time and energy. 
       If you want to play well, the most important thing is to arrange your time as rationally as possible. Any of your 1 Every action changes your status and skills 
      </p>
   </div>
   <div id="blanks"></div>
   <div id="login">
      <form method="post">
         User name: <input type="text" name="username" ><br/>
         The secret &nbsp;&nbsp; Code: <input type="password" name="password"><br/>
          <input type="submit" value=" submit ">
      </form>
       <div id="btnclose" style="position:absolute;left:93%;top:0%;z-index:5;">
         <img src="close.png" onclick="hidediv();"/>
       </div>
   </div>
</body>
</html>
<script type="text/javascript">
 function setHeight()
 {
    var h=document.documentElement.scrollHeight;
    document.getElementById("blanks").style.height=h+"px";
   }
 function hidediv()
  {
    document.getElementById("login").style.display="none";
    document.getElementById("blanks").style.display="none";
   }
 function showLogin()
 {
    document.getElementById("login").style.display="block";
    document.getElementById("blanks").style.display="block";
   }
</script>

The core of the above code is


<script type="text/javascript">
 function setHeight()
 {
    var h=document.documentElement.scrollHeight;
    document.getElementById("blanks").style.height=h+"px";
   }
 function hidediv()
  {
    document.getElementById("login").style.display="none";
    document.getElementById("blanks").style.display="none";
   }
 function showLogin()
 {
    document.getElementById("login").style.display="block";
    document.getElementById("blanks").style.display="block";
   }
</script>

Example 2:


<!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>
  <title></title>
  <script type="text/javascript">
    function showLogin() {
      var loginDiv = document.getElementById("loginDiv");
      var zhezhao = document.getElementById("zhezhao");
      var clientx = document.documentElement.clientWidth;
      var clienty = document.documentElement.clientHeight;
      var l_margin = (clientx - parseInt(loginDiv.style.width)) / 2;
      var t_margin = (clienty - parseInt(loginDiv.style.height)-200) / 2
      loginDiv.style.left = l_margin + "px";
      loginDiv.style.top = t_margin +"px";
      loginDiv.style.display = "block";
      zhezhao.style.display = "block";
    }
    function hidLogin() {
      var loginDiv = document.getElementById("loginDiv");
      var zhezhao = document.getElementById("zhezhao");
      loginDiv.style.display = "none";
      zhezhao.style.display = "none";
    }
    function titleMove() {
      var moveable = true;
      var loginDiv = document.getElementById("loginDiv");
      // The following variables are set in advance             var clientX = window.event.clientX;
      var clientY = window.event.clientY;
      var moveTop = parseInt(loginDiv.style.top);
      var moveLeft = parseInt(loginDiv.style.left);
      document.onmousemove = function MouseMove() {
        if (moveable) {
          var y = moveTop + window.event.clientY - clientY;
          var x = moveLeft + window.event.clientX - clientX;
          if (x > 0 && y > 0) {
            loginDiv.style.top = y + "px";
            loginDiv.style.left = x + "px";
          }
        }
      }
      document.onmouseup = function Mouseup() {
        moveable = false;
      }
    }
  </script>
</head>
<body>
<!--Main start z-index:0-->
<div id="Main" style="position:absolute;z-index:0;">
<a href="javascript:showLogin()"> landing </a>
</div>
<!--Main start z-index:0-->
<!--loginDiv start :z-index:2-->
<div id="loginDiv" style="background-color:white;width:300px;height:150px;border:1px solid blue;z-index:2;display:none;position:absolute;border-top:none">
  <div onmousedown="titleMove()" id="login_title" style="width:300px;height:25px;background-color:Blue;border:1px solid silver;border-left:none;border-right:none">
    <!--<img src="http://www.zhujiangroad.com/images/close.jpg" style="float:right" onclick="hidLogin()"/>-->
    <a href="javascript:hidLogin()" style="float:right;text-decoration:none;color:white;margin-right:2px;font-size:20px"> x </a>
  </div>
  <table style="clear:right;width:298px;height:115px;text-align:right;margin-top:10px;">
    <tr><td> User name: </td><td><input type="text" style="width:180px;" /></td><td> </td></tr>
    <tr><td> password :</td><td><input type="text" style="width:180px;" /></td><td> </td></tr>
    <tr><td><br /></td><td></td></tr>
  </table>
</div>
<!--loginDiv end :z-index:2-->
<!--zhezhao start: z-index:1-->
<div id="zhezhao" style="position:absolute;z-index:1;width:100%;height:100%;background-color:silver;display:none;opacity:.5;">
<!--zhezhao end-->
</div>
</body>
</html>

Example 3:


<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title> The implementation code of the pop-up login box </title>
</head>
<body>
<style type="text/css">
body {
margin: 0px;padding:0
}
#div1 {
display: none;
position: absolute;
z-index: 1000;
height: 100%;
width: 100%;
background: #000000;
filter:Alpha(opacity=30);
}
#div2 {
display: none;
position: absolute;
height: 100%;
width: 100%;
padding-top: 10%;
z-index: 1001;
left: 0px;
top: 0px;
}
</style>
<script>
function openme(){
document.getElementById('div1').style.display='block';
document.getElementById('div2').style.display='block';
}
function closeme(){
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='none';
}
function logo_in(){alert()
// validation 
// Turn to ...
//myform.action=""
//myform.submit()
closeme();
}
</script>
<div id="div1"></div>
<div id="div2">
<table width="30%" border="0" cellpadding="3" cellspacing="1" style="background: #ff7300; position:static;filter:progid:DXImageTransform.Microsoft.DropShadow(color=#666666,offX=4,offY=4,positives=true)" align="center">
<tr id="m_tr">
<td><font color="#FFFFFF"> Welcome to login: </font></td>
<td align="right">
<input type="button" value=" x " onClick="closeme()" style="cursor: hand;">
</td>
</tr>
<tr>
<form name="myform" method="post" >
<td colspan="2" width="100%" bgcolor="#FFFFFF" height="150">
username: <input type="text" name="username" size="10">
<br>pasword:<input type="password" name="pasword" size="12">
<br><input type="button" name="logoin" value=" landing " onClick="logo_in()">
<input type="button" name="exit" value=" cancel " onClick="closeme()">
</td>
</form>
</tr>
</table>
</div>
<div>
<input name="button" type="button" onClick="openme()" value=" landing " />
</div>
<br>
<div>
 Simple code 
</div>
</body>
</html>

Example 4

js made the special effect of the login form code with the mask pop-up layer


<!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=utf-8"/>
<title>js Create a pop-up layer with a mask to achieve the login registration form code effects </title>
<link rel="stylesheet" type="text/css" href="css/198zone.css">
</head>
<body>
<a class="btn01" data-toggle="modal" href="#login-modal"> The login </a>
<a class="btn02" data-toggle="modal" href="#signup-modal"> registered </a>
<a class="btn03" data-toggle="modal" href="#forgetform"> Retrieve password </a>
<a class="btn02" data-toggle="modal" href="#activation-modal"> The user information </a>
<a class="btn03" data-toggle="modal" href="#setpassword-modal"> To reset your password </a>
<div class="modal" id="login-modal">
<a class="close" data-dismiss="modal"> x </a>
<h1> The login </h1>
<ul class="login-bind-tp">
<li class="qweibo"> <a href="https://www.ofstack.com"><em>&nbsp;</em> QQ The login </a> </li>
<li class="sina"> <a href="https://www.ofstack.com"><em>&nbsp;</em>  Micro boden record </a> </li>
<li class="douban"> <a href="https://www.ofstack.com"><em>&nbsp;</em>  Douban login </a> </li>
</ul>
<p> Or log in with an existing account: </p>
<form class="login-form clearfix" method="post" action="https://www.ofstack.com">
<div class="form-arrow"></div>
<input name="email" type="text" placeholder=" Email address: ">
<input name="password" type="password" placeholder=" Password: ">
<input type="submit" name="type" class="button-blue login" value=" The login ">
<input type="hidden" name="return-url" value="">
<div class="clearfix"></div>
<label class="remember"><input name="remember" type="checkbox" checked /> Next automatic login  </label>
<a class="forgot"> Forget your password? </a>
<ul class="third-parties">
<li><p> Sina weibo account </p></li>
<li><p> Tencent weibo account </p></li>
<li><p> Douban account </p></li>
<li><p></p></li>
</ul>
</form>
</div>
<div class="modal" id="signup-modal">
<a class="close" data-dismiss="modal"> x </a>
<h1> registered </h1>
<ul class="login-bind-tp">
<li class="qweibo"> <a href="https://www.ofstack.com"><em>&nbsp;</em> QQ The login </a> </li>
<li class="sina"> <a href="https://www.ofstack.com"><em>&nbsp;</em>  Micro boden record </a> </li>
<li class="douban"> <a href="https://www.ofstack.com"><em>&nbsp;</em>  Douban login </a> </li>
</ul>
<p> Or use email to register: </p>
<form class="signup-form clearfix" method="post" action="https://www.ofstack.com">
<p class="error"></p>
<input name="email" type="text" placeholder=" Email address: ">
<input name="password" type="password" placeholder=" Password: ">
<input name="password1" type="password" placeholder=" Confirm password: ">
<input name="username" type="text" placeholder=" User name: ">
<input type="hidden" name="title" value="">
<input type="hidden" name="url" value="">
<div class="clearfix"></div>
<input type="button" name="type" class="button-blue reg" value=" registered " data-action="regist">
<ul class="third-parties">
<li><p> Sina weibo account </p></li>
<li><p> Tencent weibo account </p></li>
<li><p> Douban account </p></li>
</ul>
</form>
</div>
<div class="modal" id="forgetform">
<a class="close" data-dismiss="modal"> x </a>
<h1> Forgot password </h1>
<form class="forgot-form" method="post" action="https://www.ofstack.com">
<input name="email" value="" placeholder=" Registration Email address: ">
<div class="clearfix"></div>
<input type="submit" name="type" class="forgot button-blue" value=" Send a reset password message ">
</form>
</div>
<div class="modal" id="activation-modal">
<a class="close" data-dismiss="modal"> x </a>
<h1> Set user information </h1>
<form class="signup-form clearfix" method="post" action="https://www.ofstack.com">
<input autocomplete=off name="username" value="" placeholder=" User name: ">
<input autocomplete=off name="password" type="password" placeholder=" Password: ">
<input autocomplete=off name="password2" type="password" placeholder=" Confirm password: ">
<input type="submit" name="type" class="button-blue reg" value=" Confirm and log in " data-action="regist">
<div class="clearfix"></div>
</form>
</div>
<div class="modal" id="setpassword-modal">
<a class="close" data-dismiss="modal"> x </a>
<h1> To reset your password </h1>
<form class="signup-form clearfix" method="post" action="https://www.ofstack.com">
<input name="email" value="">
<input name="password" type="password" placeholder=" Password: ">
<input name="password2" type="password" placeholder=" Confirm password: ">
<input name="token" type="hidden" value="">
<input type="submit" name="type" class="button-blue reg" value=" Set a new password and log in " data-action="reset">
<div class="clearfix"></div>
</form>
</div>
<script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="js/modal.js"></script>
<script type="text/javascript">
$(document).ready(function(){

	$("a.forgot").click(function(){
		$("#login-modal").modal("hide");
		$("#forgetform").modal({show:!0})
	});
	
	$("#signup-modal").modal("hide");
	$("#forgetform").modal("hide");
	$("#login-modal").modal("hide");
	$("#activation-modal").modal("hide");
	$("#setpassword-modal").modal("hide");
	
});
</script>
<div style="display:none"><script src="http://demo.ofstack.com/js/tj.js"></script></div>
<script src="http://demo.ofstack.com/js/yxj.js" type="text/javascript"></script>
</body>
</html>

Presentation: http: / / demo. ofstack. com/js / 2014 / jquery - zzdcc - dlzcbd /


Related articles: