-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrightcol_open_close.js
More file actions
35 lines (27 loc) · 1.08 KB
/
rightcol_open_close.js
File metadata and controls
35 lines (27 loc) · 1.08 KB
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
const RightCol = document.querySelector('.RightColumn'),
RightColButton1 = document.querySelector('.RightColumnButton1'),
RightColButton2 = document.querySelector('.RightColumnButton2');
let i = 0;
setTimeout(function() {
RightCol.style.display = 'block';
RightCol.classList.add('FadeIn');
}, 5000);
RightColButton1.onclick = function() {
RightCol.classList.remove('FadeIn');
RightCol.classList.add('FadeOut');
i = i + 1;
console.log('Хрень закрыта '+ i + ' раз(а).');
setTimeout(() => RightCol.style.display = 'none', 500);
setTimeout(function() {
RightCol.classList.remove('FadeOut');
RightCol.style.display = 'block';
RightCol.classList.add('FadeIn');
if (i >= 2) RightColButton2.style.display = 'block';
}, 60000);
};
RightColButton2.onclick = function() {
RightCol.classList.remove('FadeIn');
RightCol.classList.add('FadeOut');
console.log('Хрень закрыта навсегда на ' + (i + 1) + '-й раз!');
setTimeout(() => RightCol.style.display = 'none', 500);
};