The following code allows me to close an overlay when I click on the #boxclose_4, however I would like to be able to click outside the overlay to close it as well.
$('#boxclose_4').click(function(){
box_4.animate({'top':'-400px'},500,function(){
overlay2.fadeOut(1000);
});
});
If I add body (‘#boxclose_4, body’) as soon as box_4 comes down the overlay disappears and appears quickly.
Any help?
Thanks
You want to add the
.overlayas an event, notbodyhttp://jsfiddle.net/YxhWx/1/