javascript 倒计时

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网页倒计时间表</title>
<style type="text/css">
*{margin:0;padding:0;}
#content{width:300px;margin:0 auto;padding:10px;background:#eee;border:1px solid #999;}
#content p span{color:red;font:bold 20px Arial;}
#content p a{font:12px/23px ’宋体’;color:#888;}
.div1{ display:none;}
</style>
</head>
<body><div id="content">
<p>
<a href="/016/2013-03-12/16267.html" title="武汉大学120周年校庆日倒计时"  class="l" style="line-height:70px;font-family:微软雅黑;font-weight:bold;font-size:26px;color:#0e54a9;">武汉大学120周年校庆日倒计时:</a>
<span id="times"></span>
</p>
</div>
<SCRIPT LANGUAGE="JavaScript">
function fresh()
{
var endtime=new Date("2013/11/29,00:00:00");
var nowtime = new Date();
var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
d=parseInt(leftsecond/3600/24);
document.getElementById("times").innerHTML=d + ''
clearInterval(sh);

}
fresh()
var sh;
sh=setInterval(fresh,1000);
</SCRIPT>
</body>
</html>

 

posted @ 2013-03-13 22:09  孤独的小马哥  阅读(174)  评论(0)    收藏  举报