I'm calling a login using a modal window (its in Worpress, but the log in for another service). I'm trying to add a button to get the modal window to close - it looks like it should work, but its not... any ideas?
Here's the js I'm using:
<script type="text/javascript">
function overlay() {
el = document.getElementById("overlay");
el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}
$(function(){// document.ready shorthand
$('.close-btn').click(function() {
$('#overlay,.login-popup').fadeOut('3000',function(){//use 3000 in place of 300m
$('#overlay').remove();
});
return false;
});
});
</script>
The html for the close button:
<a class="close-btn" href="#">Close</a>
And the css:
#overlay {
visibility: hidden;
position: absolute;
left: 0px;
top: 0px;
width:100%;
height:100%;
text-align:center;
z-index: 1000;
background-image:url(../background_trans.png);
background-repeat:repeat;
}
#overlay_content {
width:275px;
width:19.64285714rem;
margin: 100px auto;
background-color: #ebf1e3;
border:1px solid #ccc;
padding:25px;
text-align:left;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
line-height:175%;
}