- <SCRIPT LANGUAGE="JavaScript">
- function _fresh()
- {
- var endtime=new Dat("2010/12/11,10:16:12");
- var nowtime = new Date();
- var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);
- __d=parseInt(leftsecond/3600/24);
- __h=parseInt((leftsecond/3600)%24);
- __m=parseInt((leftsecond/60)%60);
- __s=parseInt(leftsecond%60);
- document.getElementById("times").innerHTML=__d+"天 "+__h+"小时"+__m+"分"+__s+"秒";
- if(leftsecond<=0){
- document.getElementById("times").innerHTML="抢购已结束";
- clearInterval(sh);
- }
- }
- _fresh()
- var sh;
- sh=setInterval(_fresh,1000);
- </SCRIPT>
- <style type="text/css">
- *{margin:0;padding:0;}
- #content{width:250px;margin:0 auto;padding:10px;background:#eee;border:1px solid #999; float:right;}
- #content p span{color:red;font:bold 20px Arial;}
- </style>
- <div id="content">
- <p>还剩<span id="times"></span></p>
- <p></p>
我见了一个标签,var endtime=new Dat("2010/12/11,10:16:12")在这里传入时间,但是前台没效果,怎么回事呢?