-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
42 lines (34 loc) · 982 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// First Modal
var modal = document.getElementById("rsvp-modal");
var btn = document.getElementById("rsvp-button");
var span = document.getElementsByClassName("close")[0];
btn.onclick = function() {
modal.style.display = "flex";
}
span.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
// Second Modal
var modal2 = document.getElementById("rsvp-modal-2");
var continueButton = document.getElementById("continue-button");
continueButton.onclick = function() {
modal.style.display = "none";
modal2.style.display = "flex";
}
var closeButtons = document.getElementsByClassName("close");
for (let i = 0; i < closeButtons.length; i++) {
closeButtons[i].onclick = function() {
modal.style.display = "none";
modal2.style.display = "none";
}
}
window.onclick = function(event) {
if (event.target == modal2) {
modal2.style.display = "none";
}
}