I am trying to make a simple popup without extensions to jquery. The popup load on page load like it should, but the problem I am having is making some way to close the popup without it automatically re-initating when I do so.Which it currently does, because it is attached to $(document).ready(. Thanks :)
$(document).ready(function(){
$('#page').animate({"opacity":"0.4"});
$('#popup').delay(300开发者_运维百科).fadeIn('slow');
$('#close').click( function() {
$('#page').animate({"opacity":"1"});
$('#popup').fadeOut('fast');
})
})
If #close is a link with href, you may try this:
$('#close').click( function(event) {
event.preventDefault();
$('#page').animate({"opacity":"1"});
$('#popup').fadeOut('fast');
});
精彩评论