I made a jquery popup box, and I am having trouble getting the background of the page to darken when the windw pops up.
The url to the page is http://rejuvenateusa.org/endorsements.html.
Heres the code I am using:
html:
<div class="cover"></div>
<div class="popup">
<div class="close"><img src="images/test_eherenfeldbig.jpg" /><button>close</button></div>
</div>
<div class="letters">
<div class="open">
<div class="letter"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','images/test_ehrenfeldmag.jpg',1)"><img src="images/test_ehrenfeld.jpg" name="Image9" width="150" height="180" border="0" id="Image9" /></a></div>
<div class="name">Rabbi Simcha Bunim Ehrenfeld</div>
</div>
css:
.popup
{
position:fixed;
border:solid 1px black;
/*width:200px;
height:200px;*/
left:100px;
top:100px;
margin:-100px 0 0 -100px;
display:none;
background-color:red;
z-index:2000;
}
.cover
{
background-color:black;
width:100%;
height:100%;
display:none;
position:fixed;
z-index:5000;
}
jquery:
<script>
$(document).ready(function () {
$(".open").click(function () {
$(".popup").fadeIn(500);
$(".cover").fadeTo(500, 0.5);
});
$(".close").click(function () {
$(".popup").fadeOut(500);
$(".cover").fadeOut(500);
});
});
</script>
Any suggestions as to why the "cover" doesnt have the effect?
Thanks.