var countDown = function (option) {
var countD = function (option) {
clearTimeout(this.timer);
var tag = option.tag,
count = option.count,
cb = option.cb;
tag.html(count + "s后重发");
if (count == 0) {
cb && cb();
} else {
count--;
this.timer = setTimeout(function () {
countD({
tag: tag,
count: count,
cb: cb
});
}, 1000);
}
}
countD(option);
}
countDown({
tag: $("#sendCode"),
count: 60,
cb: function () {
$("#sendCode").html("重发").removeClass("disable").addClass("active");
codeMessage = '';
}
});