countdown-from-new-years-without-seconds.html 913 Bytes
Newer Older
sistem17user committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<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 past. In this case, it's always been since Jan 1
				var pastDate  = new Date(currentDate.getFullYear(), 0, 1);

				// Calculate the difference in seconds between the future and current date
				var diff = currentDate.getTime() / 1000 - pastDate.getTime() / 1000;

				// Instantiate a coutdown FlipClock
				clock = $('.clock').FlipClock(diff, {
					clockFace: 'DailyCounter',
					showSeconds: false
				});
			});
		</script>
		
	</body>
</html>