Skip to content

Instantly share code, notes, and snippets.

@andrew-svirin
Last active November 14, 2019 12:13
Show Gist options
  • Save andrew-svirin/0ea7f437e963e05074a752cd42abc863 to your computer and use it in GitHub Desktop.
Save andrew-svirin/0ea7f437e963e05074a752cd42abc863 to your computer and use it in GitHub Desktop.
/**
* Make bootstrap modal dialogs stackable.
*/
$(document).on('show.bs.modal', '.modal', function () {
const 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);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment