-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathanimations.js
27 lines (26 loc) · 1.4 KB
/
animations.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
function flyOut(id, duration) {
animationName_before = document.getElementById(id).style.animationName
animationDuration_before = document.getElementById(id).style.animationDuration
document.getElementById(id).style.animationDuration = duration+"ms"
document.getElementById(id).style.animationName = "fly-out"
document.getElementById(id).classList.add("fly-out")
setTimeout(function () {
document.getElementById(id).hidden = true
document.getElementById(id).classList.remove("fly-out")
document.getElementById(id).style.animationName = animationName_before
document.getElementById(id).style.animationDuration = animationDuration_before
}, duration-10)
}
function fadeOut(id, duration) {
animationName_before = document.getElementById(id).style.animationName
animationDuration_before = document.getElementById(id).style.animationDuration
document.getElementById(id).style.animationDuration = duration+"ms"
document.getElementById(id).style.animationName = "fade-out"
document.getElementById(id).classList.add("fade-out")
setTimeout(function () {
document.getElementById(id).hidden = true
document.getElementById(id).classList.remove("fade-out")
document.getElementById(id).style.animationName = animationName_before
document.getElementById(id).style.animationDuration = animationDuration_before
}, duration-10)
}