Article Introduction: use JQ to make a very simple masking layer. |
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<script type= "Text/javascript" src= "Http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js" ></ Script>
<title>demo</title>
<style type= "Text/css" >
body{
font:12px Verdana, Arial, Helvetica, Sans-serif;
}
. Mask {
Position:absolute;
top:0px;
Filter:alpha (opacity=60);
Background-color: #B2B2B2;
z-index:999;
left:0px;
opacity:0.5;
-moz-opacity:0.5;
}
. content{
Display:none;
padding:25px 20px;
width:600px;
border:1px solid #b2b2b2;
Background: #fff;
z-index:1000;
position:fixed;
left:25%;
top:20%;
}
. Content H3,.content p{
padding:10px;
Background: #888;
Color: #fff;
}
#close {
Cursor:pointer;
font-size:20px;
Color: #888;
Position:absolute;
top:5px;
right:20px;
}
#open1 {
width:90px;
Color: #000;
Cursor:pointer;
padding:10px;
Background: #888;
Color: #fff;
}
</style>
<script type= "Text/javascript" >
$ (function () {
$ ("#open1"). Click (function () {
$ ("#mask"). CSS ({
"Height": $ (document). Height (),
"width": $ (document). Width ()
). Show ();
})
$ ("#open1"). Click (function () {
$ (". Content"). Show ();
})
$ ("#close"). Click (function () {
$ (". Content"). Hide ();
$ ("#mask"). Hide ();
})
})
</script>
<body>
<div id= "Mask" class= "Mask" ></div>
<div id= "Open1" > click Show Mask Layer </div>
<ul>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
<li>html 5</li>
</ul>
<div class= "Content" >
<p>xhtml is a more rigorous and purer version of HTML.
In the W3school XHTML tutorial, you will learn about the differences between HTML and XHTML, and the advantages of XHTML.
We'll also show you how to upgrade your site to XHTML to help you quickly deploy XHTML technology.
XHTML has become the first choice for good front-end designers and engineers. Now start learning XHTML! </p>
<span id= "Close" >x</span>
</div>
</body>