<style>
body{font-family:arial, Helvetica, Sans-serif; Color: #FFF;}
. divpopup{
Position:absolute;
/* Set height to required height, i.e. height not fixed */
width:100%;
height:100%;
left:0;
top:0;
z-index:9999;
}
. mobal{
Position:absolute;
width:100%;
height:100%;
Display:block;
Background-color: #000;
opacity:0.4;
/* Compatible with Firefox */
Filter:alpha (opacity=80);
Z-index:-1;
}
button{border:solid 1px #EEE; border-radius:4px; Background-color: #F4F; color: #FFF; font-size:13px; PADDING:2PX 5px;}
. content{Text-align:center;}
</style>
<script src= "Assets/js/jquery-1.9.1.min.js" ></script>
<script>
$ (function () {
$ ("#btn1"). Bind ("click", Function () {
$ (". Divpopup"). FadeIn (200);
$ ("#btn2"). Unbind (). bind ("click", Function () {
$ (". Divpopup"). FadeOut (200);
})
})
})
</script>
<body>
<button type= "button" id= "BTN1" > Show popup Layer </button>
<!--used to wrap the pop-up layer and its contents this is the div that needs to be overwritten when the popup layer appears--
<div class= "Divpopup" style= "Display:none;" >
<!--pop-up layer---
<div class= "Mobal" ></div>
<div class= "Content" style= "text-align:center; Color: #FFF; " >
<p > Pop-up layers need to display all the content </p>
<button type= "button" id= "BTN2" > Close popup layer </button>
</div>
</div>
</body>
Translucent pop-up layer