$(function(){
$("#sendCode").click(function () {
//1. 给指定手机发送验证码
// 2 倒计时效果
if($(this).hasClass("disabled")){
//正在倒计时 点击没反应
}else{
timeoutchangeStyle()
}
});
})
var num = 60;
function timeoutchangeStyle(){
$("#sendCode").attr("class","disabled");
if(num ==0){
$("#sendCode").text("点击发送验证码");
$("#sendCode").attr("class","");
num=60;
}else{
$("#sendCode").text(num+"s后重新发送");
setTimeout("timeoutchangeStyle()",1000)
}
num--;
}
倒计时效果
最新推荐文章于 2022-08-18 17:52:27 发布