Minimalist jQuery Countdown Timer Plugin - countdown.js

Minimalist jQuery Countdown Timer Plugin - countdown.js
File Size: 3.37 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

countdown.js is an ultra-light jQuery countdown timer plugin which counts down from a specific date and injects countdown elements (ie, days, hours, minutes) into selected elements for easier styling.

How to use it:

1. Put jQuery library and the countdown.js script at the end of the html document.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="countdown.js"></script>

2. The basic HTML structure for the countdown timer.

<div id="countdown">
  <span class="years"></span> years
  <span class="days"></span> days
  <span class="hours"></span> hours
  <span class="mins"></span> minutes
  <span class="secs"></span> Seconds
</div>

3. Call the function on the top container and specify the date you wish to countdown from.

$('#countdown').countdown({
  date: '5 september 2020 23:5'
});

4. Execute a callback function when the countdown timer is finished.

$('#countdown').countdown({
  date: '5 september 2020 23:5'
}, function() {
  $('#countdown').text('we are live');
});

This awesome jQuery plugin is developed by sagar290. For more Advanced Usages, please check the demo page or visit the official website.