Digital Countdown Clock jQuery - Download Easy Digital Countdown Clock Plugin With jQuery

Download Easy Digital Countdown Clock Plugin With jQuery

Posted on

This time I will share jQuery Plugin and tutorial about Easy Digital Countdown Clock Plugin With jQuery, hope it will help you in programming stack.

Digital Countdown Clock jQuery - Download Easy Digital Countdown Clock Plugin With jQuery
File Size: 6.82 KB
Views Total: 11593
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

countdown-timer.js is a very small jQuery plugin for creating an easy-to-style digital clock to count down from a specific date on your coming soon/under construction pages and event landing pages.

How to use it:

1. Create an empty element for the countdown timer plugin.

1 <div class="timer" id="countdown"></div>

2. Download and include the countdown-timer.js plugin after jQuery library (slim build is recommended):

1 <script src="//code.jquery.com/jquery-3.2.1.slim.min.js"></script>
2 <script src="countdown-timer.js"></script>

3. The JavaScript to render a countdown timer in the container element you just created.

1 var myDate = new Date();
2 myDate.setDate(myDate.getDate() + 2);
3 $("#countdown").countdown(myDate, function (event) {
4   $(this).html(
5       event.strftime(
6           '<div class="timer-wrapper"><div class="time">%D</div><span class="text">days</span></div><div class="timer-wrapper"><div class="time">%H</div><span class="text">hrs</span></div><div class="timer-wrapper"><div class="time">%M</div><span class="text">mins</span></div><div class="timer-wrapper"><div class="time">%S</div><span class="text">sec</span></div>'
7       )
8   );
9 });

4. Style the countdown timer using your own CSS styles.

01 .timer {
02   padding: 10px;
03   text-align: center;
04   padding-top: 15px;
05 }
06  
07 .timer .timer-wrapper {
08   display: inline-block;
09   width: 60px;
10   height: 50px;
11 }
12  
13 .timer .timer-wrapper .time {
14   font-size: 28px;
15   font-weight: bold;
16   color: #ffffff;
17 }
18  
19 .timer .timer-wrapper .text {
20   font-size: 12px;
21   color: rgba(255, 255, 255, 0.6);
22 }

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

source : jqueryscript.net