{
wait:90,
hsTime:function(that){
if (this.wait == 0) {
$('#hsbtn').removeAttr("disabled").val('重发短信验证码');
this.wait = 90;
} else {
var _this = this;
$(that).attr("disabled", true).val('在'+_this.wait+'秒后点此重发');
_this.wait--;
setTimeout(function() {
_this.hsTime(that);
}, 1000)
}
},
}
wait:90,
hsTime:function(that){
if (this.wait == 0) {
$('#hsbtn').removeAttr("disabled").val('重发短信验证码');
this.wait = 90;
} else {
var _this = this;
$(that).attr("disabled", true).val('在'+_this.wait+'秒后点此重发');
_this.wait--;
setTimeout(function() {
_this.hsTime(that);
}, 1000)
}
},
}
本文介绍了一种短信验证码倒计时功能的实现方式,通过JavaScript控制按钮的状态和显示文本,在90秒内禁止用户重复点击发送验证码,提高了用户体验并减少了服务器负担。
336

被折叠的 条评论
为什么被折叠?



