Minimal Digital Countdown Plugin with jQuery and Moment.js

File Size: 26.4 KB
Views Total: 7261
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Minimal Digital Countdown Plugin with jQuery and Moment.js

Digital Countdown is a lightweight jQuery plugin which uses moment.js to create a 7-Segment LED display-style digital countdown to a given date/time.

How to use it:

1. Include jQuery and moment.js JavaScript libraries on the webpage.

<script src="/path/to/jquery.min.js"></script>
<script src="/path/to/moment.min.js"></script>

2. Include the main CSS and JavaScript files on the webpage.

<link href="css/base.css" rel="stylesheet">
<script src="js/digital-countdown.js"></script>

3. Create a countdown container with the required CSS class 'clock'.

<div id="demo" class="clock"></div>

4. Call the function on the target container and specify the date you want to countdown to.

$("#demo").countdownDigital({
  dateTo: '2020-12-05T17:00'
});

5. Configuration options.

$("#demo").countdownDigital({

  // specify the date you want to countdown from
  dateNow: null,

  // displays labels
  labels: true,

  // displays blank digits
  showBlank: true'
  
});

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