百度博客倒记时的代码是什么

来源:百度知道 编辑:UC知道 时间:2024/04/28 10:53:11

<div id="topbar_mid_m"><Script Language="JavaScript">
var timedate= new Date("August 8,2008");
var times="北京奥运会";
var now = new Date();
var date = timedate.getTime() - now.getTime();
var time = Math.floor(date / (1000 * 60 * 60 * 24));
if (time >= 0) ;
document.write("<font style='font-size:12px;line-height:18px;color:#000000'>离2008"+times+"开幕还有:</font><font style='color:#F5A100;line-height:32px;font-family:Verdana;font-size:12px;'><b>"+time +"</b></font><font style='font-size:12px;line-height:18px;color:#000000'>天</font>");
</Script></div>