[html] <div></div> <script> var pad = function(num){ return num<10 ? "0"+num : num;}; var fresh = function(){ var nowtime = new Date(); var endtime = 1380556800; //2013-11-17 23:59:59 var _left = parseInt(endtime - nowtime.getTime()/1000); var __d = Math.floor(_left/3600/24); var __h = parseInt((_left/3600)%24); var str = "<span id=day>"+ pad(__d) +"</span><span id=hour>"+ pad(__h) +"</span>"; if(_left<=0){ str = "<span id=day>0</span><span id=hour>0</span>"; clearInterval(_DY); } document.getElementById("time").innerHTML = str; }; fresh(); var _DY = setInterval(\'fresh()\', 1000); </script> [/html]
JS倒计时效果
内容版权声明:除非注明,否则皆为本站原创文章。