$("#myModal").modal()
//This event fires immediately when the show instance method is called.
$('#myModal').on('show.bs.modal', function (e) {
// do something...
});
//This event is fired when the modal has been made visible to the user
$('#myModal').on('shown.bs.modal', function (e) {
// do something...
});
//This event is fired immediately when the hide instance method has been called.
$('#myModal').on('hide.bs.modal', function (e) {
// do something...
});
//This event is fired when the modal has finished being hidden
$('#myModal').on('hidden.bs.modal', function (e) {
// do something...
})
var modal_lv = 0;
$('.modal').on('shown.bs.modal', function (e) {
$('.modal-backdrop:last').css('zIndex',1051+modal_lv);
$(e.currentTarget).css('zIndex',1052+modal_lv);
modal_lv++
});
$('.modal').on('hidden.bs.modal', function (e) {
modal_lv--
});
let el = document.getElementById("modal1");
new Modal(el).show();
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-3 ml-auto">.col-md-3 .ml-auto</div>
<div class="col-md-2 ml-auto">.col-md-2 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-6 ml-auto">.col-md-6 .ml-auto</div>
</div>
<div class="row">
<div class="col-sm-9">
Level 1: .col-sm-9
<div class="row">
<div class="col-8 col-sm-6">
Level 2: .col-8 .col-sm-6
</div>
<div class="col-4 col-sm-6">
Level 2: .col-4 .col-sm-6
</div>
</div>
</div>
</div>
</div>
</div>