Skip to main content

Posts

Showing posts with the label Multiple Modals Overlay Angular

Multiple Modals Overlay -Multiple Popups on one page!

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 );  ...