I need to show two modals at the same time. First modal should be in the backgroud. I decided to use this solution Multiple modals overlay the example you can find here. The below code is copied from the provided example.
$(document).ready(function () {
$('#openBtn').click(function () {
$('#myModal').modal({
show: true
})
});
$(document).on('show.bs.modal', '.modal', function (event) {
var zIndex = 1040 + (10 * $('.modal:visible').length);
$(this).css('z-index', zIndex);
setTimeout(function() {
$('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack');
}, 0);
});
});
But there is a problem with ecsape key in the example on the chrome brower (in IE it is ok), when both windows are shown and user presses escape key the underlying window is closed and the other one stays. If there is only one modal window the escape key does not do anything.