35 lines
909 B
HTML
35 lines
909 B
HTML
|
|
<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>
|
||
|
|
|
||
|
|
<script type="text/javascript">
|
||
|
|
var clock;
|
||
|
|
|
||
|
|
$(document).ready(function() {
|
||
|
|
|
||
|
|
// Grab the current date
|
||
|
|
var currentDate = new Date();
|
||
|
|
|
||
|
|
// Set some date in the future. In this case, it's always Jan 1
|
||
|
|
var futureDate = new Date(currentDate.getFullYear() + 1, 0, 1);
|
||
|
|
|
||
|
|
// Calculate the difference in seconds between the future and current date
|
||
|
|
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000;
|
||
|
|
|
||
|
|
// Instantiate a coutdown FlipClock
|
||
|
|
clock = $('.clock').FlipClock(diff, {
|
||
|
|
clockFace: 'DailyCounter',
|
||
|
|
countdown: true
|
||
|
|
});
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
|
||
|
|
</body>
|
||
|
|
</html>
|