Found out about this cool jQuery countdown
which is initialized as such:
<script type="text/javascript">
$(function () {
$('#countdown').countdown({until:$.countdown.UTCDate(-8, 2011, 1 - 1, 1), format: 'DHMS', layout:
'<div id="timer">' + '<hr />'+
'<div id="timer_days" class="t开发者_高级运维imer_numbers">{dnn}</div>'+
'<div id="timer_hours" class="timer_numbers">{hnn}</div>'+
'<div id="timer_mins" class="timer_numbers">{mnn}</div>'+
'<div id="timer_seconds" class="timer_numbers">{snn}</div>'+
'<div id="timer_labels">'+
'<div id="timer_days_label" class="timer_labels">days</div>'+
'<div id="timer_hours_label" class="timer_labels">hours</div>'+
'<div id="timer_mins_label" class="timer_labels">mins</div>'+
'<div id="timer_seconds_label" class="timer_labels">secs</div>'+
'</div>'+
'</div>'
});
});
</script>
Any idea how must I config it to countdown until 14th of July, and to also until 18:00PM?
The documentation for that plugin is here: http://keith-wood.name/countdown.html
The snippet there is:
var newYear = new Date();
newYear = new Date(newYear.getFullYear() + 1, 1 - 1, 1);
$('#defaultCountdown').countdown({until: newYear});
That makes it countdown to the next new year. To count down to a particular date, set newyear = new Date(2011, 12-1, 25)
(that's Christmas day).
So you could do:
$('#defaultCountdown').countdown({until: new Date(2011, 07-1, 4)});
精彩评论