('.popup').hide(); $(".popoverlay").remove(); $('body').css('overflow', ''); }); $('.popup').click(function(e){ e.stopPropagation(); });