forked from srajika256/Cipher
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
35 lines (29 loc) · 764 Bytes
/
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
var main =document.getElementsByClassName('main')[0];
main.addEventListener("onclick", function(){
document.getElementById("myAnimation").style.top=;
function myMove() {
var elem = document.getElementById("myAnimation");
var pos = 0;
var id = setInterval(frame, 10);
function frame(i) {
if (pos == 350) {
clearInterval(id);
} else {
pos++;
elem.style.top = pos*i + 'px';
}
if(pos == 450){
clearInterval(id);
}else{
pos++;
elem.style.top = pos + 'px';
}
if(pos == 550){
clearInterval(id);
}else{
pos++;
elem.style.top = pos + 'px';
}
}
}
});