如何杀死已经打开的 Bootstrap 模式?jsFiddle示例:
<script>
$(function(){
$('#myModal').on('show', function() {
if(true) { /* Kill (close) this modal on some condition */}
});
});
</script>
我试过了:
if(true) { $('#myModal').modal('hide'); } // Not working
if(true) { $('#myModal').modal('toggle'); } // Too much recursion!!! :P
if(true) { return; } // Nope