I am currently trying to implement a countdown timer using the flipclockjs
library. I have managed to make it work properly when using intervals, but I am facing issues when attempting to use setDate
or similar functions.
I apologize if this question seems basic, as I am still relatively new to these concepts. Any assistance would be greatly appreciated. Thank you!
Below is the code snippet:
<html>
<head>
<link rel="stylesheet" href="../compiled/flipclock.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="../compiled/flipclock.js"></script>
</head>
<body>
<div class="clock" style="margin:2em;"></div>
<div class="message"></div>
<script type="text/javascript">
var clock;
$(document).ready(function() {
var clock;
clock = $('.clock').FlipClock({
clockFace: 'DailyCounter',
autoStart: false,
callbacks: {
stop: function() {
$('.message').html('The clock has stopped!')
}
}
});
clock.setTime(220880);
clock.setCountdown(true);
clock.start();
});
</script>
</body>