So what I'm trying to accomplish is that you close the popup by clicking anywhere outside of it. But as it is now, if you where to click on a < p> tag inside the popup, it also closes...
What I've got now is this:
$('html').click(function(e) {
var popup = $('.popup');
if(popup.length) {
if(!$(e.target).is('.popup-content') || !$(e.target).is('.popup-content').find('*')) {
popup.removeClass('in');
setTimeout(function () {
popup.remove();
}, 300);
}
}
});
Obviously !$(e.target).is('.popup-content').find('*') doesn't seem to work. And the content will not be static...
Hopefully someone has a solution