主页 > 知识库 > 网页基础 > Javascript/Ajax >
栏目列表

JS节日倒计时效果

来源: 作者: 发表于:2009-09-29 14:24  点击:
Script Language=JavaScript var timedate= new Date(October 1,2010); var times= 2010年国庆节; var now = new Date(); var date = timedate.getTime() - now.getTime(); var t
<Script Language="JavaScript">
   var timedate= new Date("October 1,2010");
   var times= "2010年国庆节";
   var now = new Date();
   var date = timedate.getTime() - now.getTime();
   var time = Math.floor(date / (1000 * 60 * 60 * 24));
   if (time >= 0)
   document.write( "现在离"+times+"还有: "+time +"天")
</Script>

    有帮助
    (11)
    78.6%
    没帮助
    (3)
    21.4%