-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
46 lines (38 loc) · 1.14 KB
/
main.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
43
44
45
46
var modal = document.getElementById('modalPopup');
var modalBtn = document.getElementById('hour');
var closeBtn = document.getElementById('close');
var modal1 = document.getElementById('modalPopup1');
var modalBtn1 = document.getElementById('web');
var closeBtn1 = document.getElementById('close1');
closeBtn.addEventListener('click', closePopup);
window.addEventListener('click', clickOutside);
function hourBtn() {
modal.style.display = 'block';
console.log("correct");
}
function closePopup() {
modal.style.display = 'none';
console.log("correct");
}
function clickOutside(e) {
if (e.target == modal) {
modal.style.display = 'none';
console.log("correct");
}
}
closeBtn1.addEventListener('click', closePopup1);
window.addEventListener('click', clickOutside1);
function webBtn() {
modal1.style.display = 'block';
console.log("correct");
}
function closePopup1() {
modal1.style.display = 'none';
console.log("correct");
}
function clickOutside1(e) {
if (e.target == modal1) {
modal1.style.display = 'none';
console.log("correct");
}
}