问题
Following these intructions does what I need but what if I want to except/prevend some of the modals from following this rule?
$(".modal a").click(function(){ $(this).closest(".modal").modal("hide");});
回答1:
Give all the modals that you want to exclude a class, like class="noclose"
. Then add that to the selector.
$(".modal:not(.noclose) a").click(function(){
$(this).closest(".modal").modal("hide");
});
来源:https://stackoverflow.com/questions/35051350/except-a-modal-from-closing-when-click-on-a-link