-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (35 loc) · 1.27 KB
/
index.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
<!doctype HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<title> 倒计时DEMO12 </title>
<meta name="author" content="zhuanghuanbin_gz" />
</head>
<body>
<div class="" id="Jtime">
</div>
<script src="countdown.js"></script>
<script type="text/javascript">
var Jtime = document.getElementById("Jtime");
function checkTime (num) {
if (num < 10) {
num = "0" + num;
}
return num;
}
new countdown({
endTime: "2014/11/18 23:59:59",
onChange: function (year,month,day,hour,minute,second) {
// day = year*365 + month*30 + day;
Jtime.innerHTML = "倒计时:" + checkTime(year) + "年" + checkTime(month) + "月" + checkTime(day) + "天" + checkTime(hour) + "时" + checkTime(minute) + "分" + checkTime(second) + "秒";
},
onComplete: function (year,month,day,hour,minute,second) {
// Jtime.innerHTML = "倒计时:00天00时00分";
Jtime.innerHTML = "已经过了:" + checkTime(year) + "年" + checkTime(month) + "月" + checkTime(day) + "天" + checkTime(hour) + "时" + checkTime(minute) + "分" + checkTime(second) + "秒";
// this.endLoop = true;//跳出递归 , 不再循环执行函数
}
});
</script>
</body>
</html>