DmitrMakeev commited on
Commit
64b71fc
·
verified ·
1 Parent(s): d4573f4

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +16 -4
pages.html CHANGED
@@ -1124,24 +1124,36 @@ var btn_2 = document.getElementById("myBtn_2");
1124
  // Get the <span> element that closes the modal
1125
  var span_2 = document.getElementsByClassName("close_2")[0];
1126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1127
  // When the user clicks the button, open the modal
1128
  btn_2.onclick = function() {
1129
- modal_2.style.display = "block";
1130
  }
1131
 
1132
  // When the user clicks on <span> (x), close the modal
1133
  span_2.onclick = function() {
1134
- modal_2.style.display = "none";
1135
  }
1136
 
1137
  // When the user clicks anywhere outside of the modal, close it
1138
  window.onclick = function(event) {
1139
  if (event.target == modal_2) {
1140
- modal_2.style.display = "none";
1141
  }
1142
  }
1143
 
1144
-
1145
  </script>
1146
 
1147
 
 
1124
  // Get the <span> element that closes the modal
1125
  var span_2 = document.getElementsByClassName("close_2")[0];
1126
 
1127
+ // Function to open the modal
1128
+ function openModal(modal) {
1129
+ currentMaxZIndex += 1;
1130
+ modal_2.style.display = "block";
1131
+ modal_2.style.zIndex = currentMaxZIndex;
1132
+ }
1133
+
1134
+ // Function to close the modal
1135
+ function closeModal(modal) {
1136
+ modal_2.style.display = "none";
1137
+ currentMaxZIndex = 20; // Reset z-index to initial value
1138
+ }
1139
+
1140
  // When the user clicks the button, open the modal
1141
  btn_2.onclick = function() {
1142
+ openModal(modal_2);
1143
  }
1144
 
1145
  // When the user clicks on <span> (x), close the modal
1146
  span_2.onclick = function() {
1147
+ closeModal(modal_2);
1148
  }
1149
 
1150
  // When the user clicks anywhere outside of the modal, close it
1151
  window.onclick = function(event) {
1152
  if (event.target == modal_2) {
1153
+ closeModal(modal_3);
1154
  }
1155
  }
1156
 
 
1157
  </script>
1158
 
1159