How to set the countdown timer in the flipclock.js plugin? The documentation did not find this item, maybe someone has a ready-made solution?
$(document).ready(function() { var clock = new FlipClock($('.clock'), {}); }); How to set the countdown timer in the flipclock.js plugin? The documentation did not find this item, maybe someone has a ready-made solution?
$(document).ready(function() { var clock = new FlipClock($('.clock'), {}); }); I ran it myself, I hope it helps)
jQuery(document).ready(function($) { var clock; var futureDate = new Date("May 29, 2016 0:00 PM EDT"); var currentDate = new Date(); var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000; function dayDiff(first, second) { return (second - first) / (1000 * 60 * 60 * 24); } if (dayDiff(currentDate, futureDate) < 100) { $('.clock').addClass('twoDayDigits'); } else { $('.clock').addClass('threeDayDigits'); } if (diff < 0) { diff = 0; } clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', language: 'ru', countdown: true }); }); Here is an example.
// Instantiate a coutdown FlipClock clock = $('.clock').FlipClock(diff, { clockFace: 'DailyCounter', clockFaceOptions: { countdown: true } }); clock.setCountdown(true); clock.face.on('stop', function() { // add 24 hours worth of seconds to the clock face clock.setFaceValue(24 * 60 * 60); clock.start(); }); http://jsfiddle.net/v66j6r5j/ it is of course strongly customized, but I think you will easily find what you need.
Source: https://ru.stackoverflow.com/questions/522700/
All Articles