I have looked at other questions and had no luck trying to integrate other answers to my own code.
At the moment, when the mouse hovers a slide down appears and when you click on the image the popup appears. I just need to fade out the background when this popup is in view.
I have created a jsfiddle to try and demonstrate what my code currently looks like.
I'm trying to create a fade/dimmed effect on the entire page when the popup is visible, which will then disappear when the popup is closed.
I have created overlay as the style to display behind the popup but still no luck.
I have tried attaching multiple classes to the function but it breaks the code and no popup appears.
This is my .overlay css:
.overlay{
background-image: url(http://dummyimage.com/600x400/000/000);
position:absolute;
top:0;
left:0;
width:100%;
z-index:100;
display:none;
text-align:left;
}
.toggledDiv {
height: 0px;
overflow: hidden;
z-index:10;
width: 130px;
padding-left:5px;
padding-right:5px;
margin-left: 15px;
background-color:white;
box-shadow: 5px 5px 5px #333;
}
This is the function that I created from a tutorial explaining how to do this:
// blur background
$(".overlay").css("height", $(document).height());
$(".toggleLink").click(function(){
$(".overlay").fadeIn();
return false;
});
$(window).bind("resize", function(){
$(".overlay").css("height", $(window).height());
});
This is my fiddle
Any ideas?