Novi Builder Plugin for visual jQuery Countdown customization
You should follow several simple steps to install this plugin:
- Copy the novi-plugin-countdown.js file to your path/to/novibuilder/plugins folder.
- Launch NoviBuilder
- Change type of counter (count down or count up);
- Set time for counter
- querySelector — contains a css selector which defines the Plugin container.
If your website doesn't contain Countdown follow the instructions below to install it.
Copy the "assets/countdown.js" and "assets/countdown.css" to website's JS and CSS folders respectively and include this files to your website.
Add basic Countdown HTML Layout:
<div class="countdown novi-countdown" data-type="until" data-time="24 Aug 2017 17:50" data-format="wdhms"></div>
"use strict";
$document.ready(function () {
var countdown = $(".countdown");
if (countdown.length) {
var i;
for (i = 0; i < countdown.length; i++) {
var countDownItem = countdown[i],
d = new Date(),
type = countDownItem.getAttribute('data-type'),
time = countDownItem.getAttribute('data-time'),
format = countDownItem.getAttribute('data-format'),
settings = [];
d.setTime(Date.parse(time)).toLocaleString();
settings[type] = d;
settings['format'] = format;
$(countDownItem).countdown(settings);
}
}
});