SHOW:
|
|
- or go back to the newest paste.
| 1 | - | <script> |
| 1 | + | |
| 2 | var modal = document.getElementById('id01');
| |
| 3 | var modals = ['id01', 'id02', 'id03', 'id04', 'id05', 'id06', 'id07', 'id08', 'id09', 'id10', 'id11', 'id12', 'id13']; | |
| 4 | var modalsObj = []; | |
| 5 | for (var modal in modals) {
| |
| 6 | - | if (event.target == modal) {
|
| 6 | + | modalsObj.push(document.getElementById(modal)); |
| 7 | - | modal.style.display = "none"; |
| 7 | + | |
| 8 | ||
| 9 | // When the user clicks anywhere outside of the modal, close it | |
| 10 | - | </script> |
| 10 | + | |
| 11 | ||
| 12 | var foundModal = modalsObj.find(event.target); | |
| 13 | if (foundModal != undefined) {
| |
| 14 | foundModal.style.display = "none"; | |
| 15 | } | |
| 16 | ||
| 17 | ||
| 18 | } |