jquery Web Production Example: Make a simple web masking layer

Source: Internet
Author: User

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>



Related Article

Alibaba Cloud 10 Year Anniversary

With You, We are Shaping a Digital World, 2009-2019

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.