문제

I've got a popup that I don't want to close unless you click off of it, however it closes whenever I click on it as well. It shouldn't close when you click inside the div with the class of "create-album-container"

$(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();
});

});
도움이 되었습니까?

해결책

Should be e.preventDefault(); - it is a function

And did you try to add

$('.create-album-container').click(function(e){
e.preventDefault();
e.stopPropagation();
return false;
});

?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top