-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualizer.html
43 lines (36 loc) · 1 KB
/
visualizer.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<img id="image" src="./frames/0.svg" height="600"/>
<div>
<button id="btnprev">prev</button>
<button id="btnnext">next</button>
</div>
<script type="text/javascript">
var hash = document.location.hash;
if (!!hash) {
hash = hash.substring(1);
var src = window.image.src;
var idx = src.lastIndexOf('/');
window.image.src = src.substring(0, idx) + '/' + hash + src.substring(idx);
}
var i = 0;
function loadAnother() {
var idx = window.image.src.lastIndexOf('/');
window.image.src = window.image.src.substr(0, idx+1) + i + '.svg';
}
window.btnprev.onclick = function() {
i--;
loadAnother();
}
window.btnnext.onclick = function() {
i++;
loadAnother();
}
</script>
</body>
</html>