jquery implementation mask layer, that is, the popup div around the gray can not operate

Source: Internet
Author: User

<%@ page language= "java" pageencoding= "UTF-8"%>

<! 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=gb2312 "/>
<title>jquery Mask Layer </title>

<style type= "Text/css" >
#BgDiv {background-color: #e3e3e3; position:absolute; z-index:99; left:0; top:0; display:none; width:100%; height : 1000px;opacity:0.5;filter:alpha (opacity=50);-moz-opacity:0.5;}

#DialogDiv {position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100; Background-color: #fff; border:1px #8FA4F5 Solid; padding:1px;}
#DialogDiv h2{height:25px; font-size:14px; Background-color: #8FA4F5; position:relative; padding-left:10px; line-height:25px;}
#DialogDiv H2 A{position:absolute; right:5px; font-size:12px; color: #000000}
#DialogDiv. form{padding:10px;}

#DialogDiv2 {position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100; Background-color: #fff; border:1px #8FA4F5 Solid; padding:1px;}
#DialogDiv2 h2{height:25px; font-size:14px; Background-color: #8FA4F5; position:relative; padding-left:10px; line-height:25px;}
#DialogDiv2 H2 A{position:absolute; right:5px; font-size:12px; color: #000000}
#DialogDiv2. form{padding:10px;}

#DialogDiv3 {position:absolute;width:400px; left:50%; top:50%; margin-left:-200px; height:auto; z-index:100; Background-color: #fff; border:1px #8FA4F5 Solid; padding:1px;}
#DialogDiv3 h2{height:25px; font-size:14px; Background-color: #8FA4F5; position:relative; padding-left:10px; line-height:25px;}
#DialogDiv3 H2 A{position:absolute; right:5px; font-size:12px; color: #000000}
#DialogDiv3. form{padding:10px;}
</style>

<script language= "javascript" type= "Text/javascript" src= "Jquery-1.4.2.min.js" ></script>
<script language= "javascript" type= "Text/javascript" >
function Showdiv (Thisobjid) {
$ ("#BgDiv"). CSS ({display: "block", Height: $ (document). Height ()});
var yscroll = Document.documentElement.scrollTop;
$ ("#" + Thisobjid). CSS ("Top", "100px");
$ ("#" + Thisobjid). CSS ("Display", "block");
Document.documentElement.scrollTop = 0;
}

function Closediv (Thisobjid) {
$ ("#BgDiv"). CSS ("display", "none");
$ ("#" + Thisobjid). CSS ("display", "none");
}
</script>


<body>
<div id= "Bgdiv" ></div>

<!--matte Layer display div1-->
<div id= "Dialogdiv" style= "Display:none" >
<div class= "form" > I am a popup dialog box 111111!! </div>
</div>

<!--matte Layer display div2-->
<div id= "DialogDiv2" style= "Display:none" >
<div class= "form" > I am a popup dialog box 2222!! </div>
</div>

<!--matte Layer display div3-->
<div id= "DialogDiv3" style= "Display:none" >
<div class= "form" > I am a popup dialog box 3333333!! </div>
</div>

<p>
<input value= "Eject mask layer 1" type= "button" id= "BtnShow1" onclick= "Showdiv (' Dialogdiv ')"/>
<input value= "Eject mask Layer 2" type= "button" id= "BtnShow2" onclick= "Showdiv (' DialogDiv2 ')"/>
<input value= "Eject mask Layer 3" type= "button" id= "BtnShow3" onclick= "Showdiv (' DialogDiv3 ')"/>
</p>
</body>

jquery implementation mask layer, that is, the popup div around the gray can not operate

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.