/**
* 设置倒计时60秒。避免恶意重复查询
* BY : LiuKing
* DATE : 20150821
*/
var t = 60;//倒计时时间(s)
var tt;//倒计时对象
var cnt = 0;//计数器
function disableButton()
{
cnt++;
tt = setTimeout('disableButton()',1000);
if(cnt>=t){
console.log('结束');
$("#otherButton").show();
clearTimeout(tt);
$("#timeCntLable").hide();
cnt = 0;
}else{
$("#timeCntLable").html('<div class="button" style="background-color: darkgrey;border-color: darkgrey;">查询将在【'+(t-cnt)+'】秒后可用。<div>');
$("#timeCntLable").show();
}
}
js倒计时
最新推荐文章于 2022-09-22 18:02:38 发布