Repository navigation
Expand file tree
/
Copy pathscripts.js
More file actions
115 lines (87 loc) · 2.61 KB
/
Copy pathscripts.js
File metadata and controls
115 lines (87 loc) · 2.61 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
var i = 187;
var i_prev = i - 1;
var j = 198;
var initialize_var = 0;
function delay_function() {
var src = document.getElementById("ISSIMG");
var img = document.createElement("img");
img.id = "img" + i;
if (initialize_var == 0) {
setTimeout(function() {
img.src = "Images/ISS 360 0-90.58." + i + ".png";
img.height = 550
img.width = 750
src.appendChild(img);
console.log(i);
i++;
initialize_var = 1;
if (i <= j) {
delay_function();
}
}, 0)
}
else if (i > 187 && i < j && i_prev < i) {
setTimeout(function() {
document.getElementById("img" + (i - 1)).remove();
img.src = "Images/ISS 360 0-90.58." + i + ".png";
img.height = 550
img.width = 750
src.appendChild(img);
console.log(i);
i_prev = i;
i++;
if (i <= j) {
delay_function();
}
}, 20000)
}
else if (i > 187 && i < j && i_prev > i) {
setTimeout(function() {
document.getElementById("img" + (i + 1)).remove();
img.src = "Images/ISS 360 0-90.58." + i + ".png";
img.height = 550
img.width = 750
src.appendChild(img);
console.log(i);
i_prev = i;
i--;
if (i >= 187) {
delay_function();
}
}, 20000)
}
else if(i == 187) {
setTimeout(function() {
document.getElementById("img" + (i + 1)).remove();
var src = document.getElementById("ISSIMG");
img.id = "img" + i;
img.src = "Images/ISS 360 0-90.58." + i + ".png";
img.height = 550
img.width = 750
src.appendChild(img);
console.log(i);
i_prev = i - 1;
i++;
if (i <= j) {
delay_function();
}
}, 20000)
}
else if(i == j) {
setTimeout(function() {
document.getElementById("img" + (i - 1)).remove();
var src = document.getElementById("ISSIMG");
img.id = "img" + i;
img.src = "Images/ISS 360 0-90.58." + i + ".png";
img.height = 550
img.width = 750
src.appendChild(img);
console.log(i);
i_prev = i + 1;
i--;
if (i <= j) {
delay_function();
}
}, 20000)
}
};