psg countdown timer - Download Countdown From A Date To Another Date - jQuery PsgTimer

Download Countdown From A Date To Another Date – jQuery PsgTimer

Posted on

This time I will share jQuery Plugin and tutorial about Countdown From A Date To Another Date – jQuery PsgTimer, hope it will help you in programming stack.

psg countdown timer - Download Countdown From A Date To Another Date - jQuery PsgTimer
File Size: 7.7 KB
Views Total: 2772
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

PsgTimer is an easy, modern, cross-browser countdown timer plugin for creating a digital clock that counts down from a date to another date you provide.

How to use it:

1. To get started, include the jQuery PsdTimer plugin and other required resources on the web page.

1 <link rel="stylesheet" href="css/psgTimer.css">
3         integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
4         crossorigin="anonymous">
5 </script>
6 <script src="js/jquery.psgTimer.js"></script>

2. Create a placeholder element for the countdown timer and specify the end time in the data-timer-end attribute:

1 <div id="demo"
2      data-timer-end="24.12.2019 23:59 UTC-04:45">
3 </div>

3. Call the plugin to the placeholder element. Done.

1 var myTimer = new PsgTimer('#demo');

4. You can also specify the end time in the JavaScript during init.

1 <div id="demo">
2 </div>
1 var myTimer = new PsgTimer('#demo',{
2     endDateTime: Date.UTC(2019, 12, 24, 0, 0, 0),
3 });

5. Stop/stop the countdown timer manually.

1 // starts the countdown timer
2 myTimer.start();
3  
4 // stops the countdown timer
5 myTimer.stop();

6. Specify the start date. Default: current local time.

1 var myTimer = new PsgTimer('#demo',{
2     currentDateTime: Date.UTC(2018, 12, 24, 0, 0, 0),
3 });

7. Enable the tick animation. Default: false.

1 var myTimer = new PsgTimer('#demo',{
2     animation: 'fade'
3 });

8. Decide whether to display the days, hours, minutes, and seconds in different slots. Default: false.

1 var myTimer = new PsgTimer('#demo',{
2     multilpeBlocks: true
3 });

9. Localize the countdown timer.

1 <div id="psgTimer"
2      data-label-days="Days"
3      data-label-hours="Hours"
4      data-label-minutes="Minutes"
5      data-label-seconds="Seconds"
6 ></div>
1 // or
2 var myTimer = new PsgTimer('#demo',{
3     labels: {
4       days: 'Days',
5       hours: 'Hours',
6       minutes: 'minutes',
7       seconds: 'seconds'
8     }
9 });

10. Callback functions available.

01 var myTimer = new PsgTimer('#demo',{
02     onInit: function () {
03     },
04     onStart: function () {
05     },
06     onStop: function () {
07     },
08     onEnd: function () {
09     },
10     onChangeStart: function () {
11     },
12     onChangeEnd: function () {
13     }
14 });

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

source : jquery.net