Ad

Except A Modal From Closing When Click On A Link

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");});
Ad

Answer

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");
});
Ad
source: stackoverflow.com
Ad