pfarmer/jquery-countdown — Issue #21: Message after countdown expires
Author: Legin76
Created: 2011-11-17 13:27:23+00:00
State: open

This may be more down to my lack of jquery knowledge.

I'm trying to do a countdown to new year that displays "Happy New Year" after midnight. It works if you have the coundown on your screen at the time, but the problem I'm getting is that if you load the page after the countdown has finished, it starts counting down again. I want it just to display the "Happy New Year" message on page loads after the coundown has finished.

The code I've used is blow.

$(function(){
var _date = new Date();
_date.setYear(2012);
_date.setMonth(0);
_date.setDate(0);
_date.setHours(0);
_date.setMinutes(0);
_date.setSeconds(0);
$('#counter').countdown({
startTime: _date,
digitWidth: 53,
digitHeight: 77,
image: 'img/digits_inverted.png',
timerEnd: function(){ $("#counter").html("

Happy New Year!

"); },
});