jCountr基于jQuery的倒计时插件jQuery 倒计时插件和实例,jCountr——运用了jQuery.Countdown.js,结合 jQuery.js而完成的倒计时效果,用法请看代码,不是太复杂。 [code] jQuery.fn.countdown = function(options) { /** * app init */ if(!options) options = '()'; if(jQuery(this).length == 0) return false; var obj = this; /** * break out and execute callback (if any) */ if(options.seconds < 0 || options.seconds == 'undefined') { if(options.callback) eval(options.callback); return null; } /** * recursive countdown */ window.setTimeout( function() { jQuery(obj).html(String(options.seconds)); --options.seconds; jQuery(obj).countdown(options); } , 1000 ); /** * return null */ return this; } [/code]

展开内容