You're close - just stop sharing when the user clicks on pop-ups:
$("#email-popup, #phone-popup").on("click", function(e){
e.stopPropagation();
});
$(".email").on("click", function(e){
e.stopPropagation();
$("#email-popup").show("fast");
});
$(".phone").on("click", function(e){
e.stopPropagation();
$("#phone-popup").show();
});
Also you have the repeated code in the click of the document. You hide the pop-up email twice.
$(document).on("click", function() {
$("#email-popup, #phone-popup").hide("fast");
});
source
share