The events called inside of $(‘.transparent-close’).click(function(){ …}); don’t seem to be working. Is it possibly because it is inside of another .click() event?
$('#featured-top').click(function(){
$(this).animate({'top':'-318px'}, 600, 'easeOutBounce');
$('#featured-top-container').animate({'margin':'260px 0 0 117px'}, 600, 'easeOutBounce');
$('#wrap').animate({'margin-top':'365px'}, 600, 'easeOutBounce');
//Add transparent background for click out
$(document.body).append('<div class="transparent-close"></div>');
$('.transparent-close').click(function(){
$('#featured-top').animate({'top':'-318px'}, 600, 'easeOutBounce');
$('#featured-top-container').animate({'margin':'260px 0 0 117px'}, 600, 'easeOutBounce');
$('#wrap').animate({'margin-top':'365px'}, 600, 'easeOutBounce');
$(this).remove();
});
});
I would use:
I had yet problems using click function as an event listener, even if I don’t know exactly why.