【问题标题】:jQuery countdown continue after datejQuery倒计时在日期之后继续
【发布时间】:2016-10-03 22:03:21
【问题描述】:

我在这里使用了这个很棒的 jQuery 代码: http://hilios.github.io/jQuery.countdown/

我正试图让它在结束日期之后工作。 你有什么主意吗? 它应该显示如下内容:

3 semaines soit 10 heures et 10 分钟

$('#timeout').countdown(finalDate, {elapse: true})
.countdown("2015/05/01 12:00:00", function(event) {
     $(this).text(
       event.strftime('%-w %!w:semaine,semaines; soit %-D %!D:jour,jours; et %-H %!H:heure,heures;')
   );
});

谢谢!

【问题讨论】:

  • 你遇到了什么问题?
  • 我想我不知道如何让它按我需要的方式工作,因为没有任何显示...我不太了解 JS,也无法真正理解如何使用它。 . 这是一个例子,但它不符合我的需要:hilios.github.io/jQuery.countdown/examples/count-up.html
  • 好的,这个例子工作得非常好。你有什么要求?
  • 我需要指定从日期开始的计数。像 2015/05/01 12:00:00 这样的东西,以便看到从这个日期到现在的倒计时!很难适应...

标签: javascript jquery jquery-countdown


【解决方案1】:

您的代码中有一些错误。

使用Doc中给出的例子,如果你这样写它就完美了:

  $('#timeout').countdown("2015/05/05 12:00:00", {elapse: true})
               .on('update.countdown', function(event) {
                   $(this).text(
                       event.strftime('%-w %!w:semaine,semaines; soit %-D %!D:jour,jours; et %-H %!H:heure,heures;')
                   );
                });

我做了一个JsFiddle作为例子

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-01
    • 1970-01-01
    相关资源
    最近更新 更多