您现在的位置是:网站首页> 软件下载软件下载
jCountr基于jquery的倒计时插件 下载-
2021-09-04
162人已围观
简介 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]
[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]



