<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<title>倒计时</title>
</head>
<script language="javascript" type="text/javascript">
function countDown(x)
{
if(x){
var timer = setTimeout("countDown()",1000)
var examDay = new Date("2014/1/1 8:00:00");
var now = new Date();
var totalSeconds = Math.floor((examDay.getTime() - now.getTime()) / 1000);
var totalMinutes = Math.floor(totalSeconds / 60);
var totalHours = Math.floor(totalMinutes / 60);
var days = Math.floor(totalHours /24);
var hours = totalHours % 24;
var startString ="XXX count down:";
var dayString =days+" Days";
var timeString =hours+" Hours";
document.write("<p align='center'><font style='color:#ff0000; font-size:40px'>"+startString+"</font></p>");
document.write("<p align='center'><font style='color:#00ff00; font-size:50px'>"+dayString+"</font></p>");
document.write("<p align='center'><font style='color:#0000ff; font-size:60px'>"+timeString+"</font></p>");
}
}
</script>
<body>
<b>
<script>
countDown(1);
</script>
</b>
</body>
</html>
html倒计时
最新推荐文章于 2022-09-19 10:36:15 发布