This code works for every “. modal ” created on the page (even dynamic modals) and backdrop instantly overlays the previous modal. The below multiple modals overlay example uses a setTimeout because the “. modal-backdrop ” is not created when the event “ show.bs.modal ” is triggered. The Example for multiple modals overlay and it looks like - //Multiple modals overlay $ ( function () { $ ( '#openBtn' ). click ( function () { $ ( '#myModal' ). modal ({ show: true }) }); //The below code works for every .modal created on the page (even dynamic modals) and backdrop instantly overlays the previous modal. $ ( document ). on ( 'show.bs.modal' , '.modal' , function ( event ) { var zIndex = 1040 + ( 10 * $ ( '.modal:visible' ). length ); $ ( this ). css ( 'z-index' , zIndex ); ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers