0

我的代码:

var mins = 30; var secs = mins * 60; var currentSeconds = 0; var currentMinutes = 0; setTimeout("Decrement("+secs+")",1000); function Decrement(secs){ secs = parseInt(secs); currentMinutes = Math.floor(secs / 60); currentSeconds = secs % 60; if(currentSeconds <= 9) currentSeconds = "0" + currentSeconds; secs--; $("#countdown").html(currentMinutes + ":" + currentSeconds); if(secs !== -1){ setTimeout("Decrement("+secs+")",1000); } if(secs == 0){ alert(''); } }

它显示分钟和秒,我想在其中添加小时数。这个怎么做。

帮助表示赞赏。谢谢

4

1 回答 1

0

这是一款适合您的倒数计时器

http://keith-wood.name/countdown.html

它有小时分钟和秒。您可以设置倒计时的日期,并且如果您阅读文档,则不难使用。简单用法:但是当您需要更多设置时,我建议您阅读整个文档

$(selector).countdown()
于 2013-06-27T09:12:37.450 回答