JQuery count timer
I was trying to achieve a countdown timer using the jquery plugin .
Since I'm new to this, I don't really understand their documentation.
I want to display. I want to display a counter that is calculated from January 1st, 2005 to the current date. Output display example
5 years 5 months 5 hours 5 seconds (will keep records in seconds)
Please kindly help me by posting snippets for the achievement. Thanks for your time and very grateful.
+2
a source to share
4 answers
try:
var sinceYear = new Date('01/01/2005');
$('#defaultCountdown').countdown({since: sinceYear});
quick demo
change more options
var sinceYear = new Date('01/01/2005');
$('#defaultCountdown').countdown({since: sinceYear,
format: 'YdHMS',
layout:'<b>{yn} {yl},{dn} {dl} and '+
'{hn} {hl}, {mn} {ml}, {sn} {sl}</b>'});
another quick demo
+7
a source to share
<html>
<head>
<title>Sample Page</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<style type="text/css">@import "jquery.countdown.css";</style>
<script type="text/javascript" src="jquery.countdown.js"></script>
<script type="text/javascript">
var epoch = new Date("1/1/2005");
$(document).ready(function(){
$("#countup").countdown({since: epoch});
});
</script>
</head>
<body>
<div id="countup">
</div>
</body>
</html>
not verified. you will need to host the location of the script files yourself.
0
a source to share