Home javascript Flipclock.js countdown

Flipclock.js countdown

Author

Date

Category

How in the Flipclock.js plugin to set the countdown timer?
The documentation did not find this item, maybe someone has a ready-made solution?

$ (document) .ready (function () {
  var Clock = New Flipclock ($. Clock '), {});
});

Answer 1, Authority 100%

I launched so much, I hope it will help)

jQuery (Document) .ready (Function ($) {
  var clock;
  var futurdate = new date ("May 29, 2016 0:00 PM EDT");
  var currentdate = new date ();
  var diff = futurdate.gettime () / 1000 - currentdate.gettime () / 1000;
  FUNCTION DAYDIFF (FIRST, SECOND) {
   Return (Second - First) / (1000 * 60 * 60 * 24);
  }
  If (DayDiff (CurrentDate, Futuredate) & LT; 100) {
   $ ('. Clock'). AddClass ('TwodayDigits');
  } else {
   $ ('. Clock'). AddClass ('threedaydigits');
  }
  if (Diff & LT; 0) {
   diff = 0;
  }
  Clock = $ ('. Clock'). Flipclock (Diff, {
   ClockFace: 'Dailycounter',
   Language: 'RU',
   Countdown: True.
  });
 });

Working Example on Plunker


Answer 2

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 certainly strongly customized, but I think you can easily find that You need.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions