如何利用jQuery写一个倒计时

2025年01月07日 建站教程

在html开发中,如何利用jQuery语法写一个倒计时功能!下面web建站小编给大家简单介绍一下!

具体代码如下:

$('#countdown').countdown('2023/05/29', function(event) {
  $(this).html(event.strftime('
<div class="countdown-section"><span class="countdown-amount days">%D</span>
<div class="countdown-period">Days</div></div>
<div class="countdown-section"><span class="countdown-amount hours">%H</span>
<div class="countdown-period">Hours</div></div><div class="countdown-section"><span class="countdown-amount minutes">%M</span>
<div class="countdown-period">Minutes</div></div><div class="countdown-section"><span class="countdown-amount seconds">%S</span>
<div class="countdown-period">Seconds</div></div>'));
}).on('finish.countdown', function(event) {
  $(this).html('The countdown is finished!');
});

本文链接:http://so.lmcjl.com/news/20877/

展开阅读全文
相关内容