-
Notifications
You must be signed in to change notification settings - Fork 0
/
pratical.js
48 lines (35 loc) · 1.45 KB
/
pratical.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
/*const affirm = document.querySelector('.affirm1, .affirm2,.affirm3');
const overlay = document.querySelector('.overlay');
const openBox = document.querySelector('.box');
const closeBox = document.querySelector('.close-modal');
const box = function(){
modal.classList.add('.hidden1, .hidden2, .hidden3');
overlay.classList.add('.hidden');
}
const affirm = document.querySelector('.affirm1.affirm2.affirm3');
const overlay = document.querySelector('.overlay');
const openBox = document.querySelector('.box');
const closeBox = document.querySelector('.close-modal');
const unlockBox = function(){
affirm.classList.remove('hidden1', 'hidden2', 'hidden3');
overlay.classList.remove('hidden');
}
const lockBox = function() {
affirm.classList.add('hidden1', 'hidden2', 'hidden3');
overlay.classList.add('hidden');
}*/
const affirm = document.querySelector('.affirm1.affirm2.affirm3');
const overlay = document.querySelector('.overlay');
const btnOpenBox = document.querySelector('.affirm1.affirm2.affirm3');
const btnCloseBox = document.querySelector('.close-modal');
const openBox = function() {
affirm.classList.remove('hidden1', 'hidden2', 'hidden3');
overlay.classList.remove('hidden');
}
const closeBox = function() {
affirm.classList.add('hidden1', 'hidden2', 'hidden3');
overlay.classList.add('hidden');
}
overlay.addEventListener('click', closeBox);
btnOpenBox.addEventListener('click', openBox);
btnCloseBox.addEventListener('click', closeBox);