-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
43 lines (35 loc) · 1.15 KB
/
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
43
function fade(element) {
var op = 1; // initial opacity
var timer = setInterval(function () {
if (op <= 0.1){
clearInterval(timer);
element.style.display = 'none';
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op -= op * 0.1;
}, 50);
}
function unfade(element) {
var op = 0.1; // initial opacity
element.style.display = 'block';
var timer = setInterval(function () {
if (op >= 1){
clearInterval(timer);
}
element.style.opacity = op;
element.style.filter = 'alpha(opacity=' + op * 100 + ")";
op += op * 0.1;
}, 10);
}
function myFunction(x) {
x.classList.toggle("change");
document.getElementById('menu').classList.toggle("change");
if (document.getElementById('menu').style.display=="block") {
// document.getElementById('menu').style.display="none";
document.getElementById('menu').style.display = 'none';
}else {
// document.getElementById('menu').style.display="block";
document.getElementById('menu').style.display = 'block';
}
}