【发布时间】:2016-04-06 02:30:14
【问题描述】:
我正在使用 The Final Countdown jQuery 脚本.. http://hilios.github.io/jQuery.countdown/
如果没有剩余时间,我想隐藏天、分钟等(即,达到 0)。
此时它会显示类似..
00 天 00 小时 13 分 58 秒
我想像这样显示它..
13 分 58 秒
HTML
<span id="clock-{{ $game->id }}"></span>
脚本
var endGame = moment.tz("{{ $game->updated_at->addDays(3) }}", "Europe/Volgograd");
$('#clock-{{ $game->id }}').countdown(endGame.toDate(), function(event) {
$(this).html(event.strftime('%-D days %-H hours %-M min %-S sec')).on('finish.countdown', function(event){
$(this).html(event.strftime('This Game has Ended.'));
$('.clock-{{ $game->id }}').fadeOut(2000);
});
});
谢谢!!
【问题讨论】:
标签: javascript jquery countdown