单击 link 时关闭模态除外

Except a modal from closing when click on a link

遵循这些 可以满足我的需要,但是如果我想 except/prevend 遵循此规则的某些模态怎么办?

$(".modal a").click(function(){ $(this).closest(".modal").modal("hide");});

为您想要排除的所有模态框提供 class,例如 class="noclose"。然后将其添加到选择器。

$(".modal:not(.noclose) a").click(function(){ 
    $(this).closest(".modal").modal("hide");
});