我有倒数计时器,它很好。我正在尝试将其转换为 COUNT UP TIMER。我对这项任务感到困惑。
我经历了很多方法,但不是确切的答案。
HTML 代码
<div class="tk_countup_time p-0 transparent_bg box_shadow_none animation" data-animation="fadeInUp" data-animation-delay="1.2s" data-time="2025/02/28 00:00:00"></div>
jQuery 代码
$('.tk_countup_time').each(function() {
var endTime = $(this).data('time');
$(this).countdown(endTime, function(tm) {
$(this).html(tm.strftime('<span class="counter_box"><span class="tk_counter days">%D </span><span class="tk_text">Days</span></span><span class="counter_box"><span class="tk_counter hours">%H</span><span class="tk_text">Hours</span></span><span class="counter_box"><span class="tk_counter minutes">%M</span><span class="tk_text">Minutes</span></span><span class="counter_box"><span class="tk_counter seconds">%S</span><span class="tk_text">Seconds</span></span>'));
});
});