-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.html
60 lines (53 loc) · 1.7 KB
/
example.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Countdown</title>
</head>
<body>
<h1>Javascript Countdown</h1>
<div>
<h2>Image Type</h2>
<img id="h1">
<img id="h2"> :
<img id="m1">
<img id="m2"> :
<img id="s1">
<img id="s2">
</div>
<div>
<h2>Text Type</h2>
<div id="countdownText"></div>
</div>
<script type="text/javascript" src="./js/countdown.js"></script>
<script>
window.onload = function () {
var countdown = new Countdown();
var today = new Date ();
var countdownTime = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
countdown.setTime(countdownTime.toDateString());
countdown.setNumImg('1', './img/n1.jpg');
countdown.setNumImg('2', './img/n2.jpg');
countdown.setNumImg('3', './img/n3.jpg');
countdown.setNumImg('4', './img/n4.jpg');
countdown.setNumImg('5', './img/n5.jpg');
countdown.setNumImg('6', './img/n6.jpg');
countdown.setNumImg('7', './img/n7.jpg');
countdown.setNumImg('8', './img/n8.jpg');
countdown.setNumImg('9', './img/n9.jpg');
countdown.setNumImg('0', './img/n0.jpg');
setInterval(function(){
countdown.printTimeImg({
'h1' : document.getElementById('h1'),
'h2' : document.getElementById('h2'),
'm1' : document.getElementById('m1'),
'm2' : document.getElementById('m2'),
's1' : document.getElementById('s1'),
's2' : document.getElementById('s2')
});
countdown.printTimeText(document.getElementById('countdownText'));
}, 1000);
}
</script>
</body>
</html>