Minimal jQuery Plugin For Countdown Timers - jQuery countDown.js

File Size: 1.86 KB
Views Total: 611
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Minimal jQuery Plugin For Countdown Timers - jQuery countDown.js

countDown.js is a super tiny jQuery countdown timer plugin that counts down from a specific time (in seconds) to zero.

When the countdown reaches zero, a callback function is called, which is great for redirecting the current page to another URL or showing a message to the users.

Looking for advanced countdown plugins? Take a look at our 10 Best Countdown Timer Plugins In JavaScript.

How to use it:

1. Insert jQuery library and the countDown.js plugin into the webpage.

<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/countDown.js"></script>

2. Create a container to hold the countdown timer.

<h1 id="countDown"></h1>

3. Initialize the countdown timer and specify the starting time the plugin should countdown from.

$("#countDown").countdownTimer({
  // default: 10
  time: 100,
});

4. Execute a callback function when the time is up.

$("#countDown").countdownTimer({
  time: 100,
  callback: function () {
    alert("Time's up!");
  },
});

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