-
Notifications
You must be signed in to change notification settings - Fork 952
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1da30b
commit 3500cc4
Showing
5 changed files
with
68 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<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() { | ||
// Set dates. | ||
var futureDate = new Date("October 9, 2014 12:02 PM EDT"); | ||
var currentDate = new Date(); | ||
|
||
// Calculate the difference in seconds between the future and current date | ||
var diff = futureDate.getTime() / 1000 - currentDate.getTime() / 1000; | ||
|
||
// Calculate day difference and apply class to .clock for extra digit styling. | ||
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; | ||
} | ||
|
||
// Instantiate a coutdown FlipClock | ||
clock = $('.clock').FlipClock(diff, { | ||
clockFace: 'DailyCounter', | ||
countdown: true | ||
}); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3500cc4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i use day countdown works good
but not responsive any suggestion plz.