Countdown
A simple and HTML agnostic date countdown plugin with different countdown options.
jQuery Countdown documentationHow to use?
Copy-paste the following <script>
near the end of your pages under JS Implementing Plugins to enable it.
Copy-paste the following <script>
near the end of your pages under JS Front to enable it.
Copy-paste the init function under JS Plugins Init., before the closing </body>
tag, to enable it.
Target date
The target date that you are seeking to countdown. This argument can be one of the following:
- A native date object
- The milliseconds from Epoch time
-
String formatted as following:
YYYY/MM/DD
MM/DD/YYYY
YYYY/MM/DD hh:mm:ss
MM/DD/YYYY hh:mm:ss
Methods
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-hs-countdown-options='{}'
. For more detailed or missing attributes/functions, see the official jQuery Countdown documentation documentation page.
Parameters | Description | Default value |
---|---|---|
|
Date from which the time period will be calculated | null |
|
A required parameter that tells the plugin the date by which a countdown is required | null |
|
Display format for years | %Y |
|
Display format for months | %M |
|
Display format for days | %D |
|
Display format for hours | %H |
|
Display format for minutes | %M |
|
Display format for seconds | %S |
|
Selector, which is responsible for the output of the years in the initialized object | '.js-cd-years' |
|
Selector, which is responsible for displaying months in the initialized object | '.js-cd-months' |
|
Selector that is responsible for displaying days in the initialized object | '.js-cd-days' |
|
Selector that is responsible for displaying hours in the initialized object | '.js-cd-hours' |
|
Selector that is responsible for displaying minutes in the initialized object | '.js-cd-minutes' |
|
Selector that is responsible for displaying seconds in the initialized object | '.js-cd-seconds' |
|
If true , initializes the element with the circles plugin (https://www.lugolabs.com/circles) |
false |
|
If circles is true , sets the fill color of SVG circles |
'#000000' |
|
If circles is true , sets the line color of SVG circles |
'#cccccc' |
|
If circles is true , then adds a postfix to the numerical value |
null |
|
If circles is true , then sets the font size inside SVG circles |
16 |
|
The radius of the circles | 80 |
|
Init value of the circle (optional, defaults to 0) | 0 |
|
Maximum value of the circle (optional, defaults to 100) | 100 |
|
The width of the ring (optional, has value 10, if not specified) | 10 |
|
Value in ms of animation's duration; defaults to 500; if 0 or null is passed, the animation will not run | 0 |