var util = {
wait:60,
hsTime: function (that) {
_this = this;
if (_this.wait == 0) {
$('#hsbtn').removeAttr("disabled").val('重发验证码').removeClass('auth-code-bg-change').addClass('auth-code-bg');
_this.wait =60;
} else {
var _this = this;
$(that).attr("disabled", true).val('倒计时' + _this.wait).removeClass('auth-code-bg').addClass('auth-code-bg-change');
_this.wait--;
setTimeout(function () {
_this.hsTime(that);
}, 1000)
}
}
}
$("#hsbtn").click(function (e) {
util.hsTime('#hsbtn');
$('.margin_rig').css({
"display":"block"
})
})
转载于:https://www.cnblogs.com/chongtao/p/5826207.html