Jquery countdown plug-in for your reference
The Code is as follows:
$ (Document). ready (function (){
/* Latency function */
JQuery. fn. delay = function (time, func ){
Return this. each (function (){
SetTimeout (func, time );
});
};
JQuery. fn. countDown = function (settings, ){
Settings = jQuery. extend ({
StartFontSize: '36px ',
EndFontSize: '12px ',
Duration: 1000,
StartNumber: 10,
EndNumber: 0,
CallBack: function (){}
}, Settings );
Return this. each (function (){
If (! To &! = Settings. endNumber) {to = settings. startNumber ;}
// Set the number starting from the countdown
Optional (this).text(to).css ('fontsize', settings. startFontSize );
// Page Animation
$ (This). animate ({
'Fontsize': settings. endFontSize
}, Settings. duration, '', function (){
If (to> settings. endNumber + 1 ){
Detail (this).css ('fontsize', settings. startFontSize). text (to-1). countDown (settings, to-1 );
}
Else {
Settings. callBack (this );
}
});
});
};
// Use
$ ('# Countdown'). countDown ({
StartNumber: 10,
CallBack: function (me ){
$ (Me). text ('all done! This is where you give the reward! '0000.css ('color', '#090 ');
}
});
});