我有一个弹出窗口,除非您单击它,否则我不想关闭它,但是每当我单击它时它也会关闭。当您在具有“create-album-container”类的 div 内单击时,它不应关闭
$(document).ready(function() {
////posts menu
$(".container").on("contextmenu", ".photos-bottom .albums li", function(e) {
var id = $(this).attr("id");
e.stopPropagation();
e.preventDefault;
$('.create-album-container').hide();
$('.photos-bottom .albums li#'+id+' .create-album-container').show();
return false;
});
$("body").click(function (event) {
$('.create-album-container').hide();
});
});