亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

怎樣讓兩個定時器不互相影響?

怎樣讓兩個定時器不互相影響?

慕無忌1623718 2018-08-18 10:09:00
<!doctype html><html><head><meta charset="utf-8"><title>無標題文檔</title></head><body><input class="code" onClick="TestGetCode(this)" value="獲取驗證碼" type="button"/><br><input class="code" onClick="TestGetCode(this)" value="獲取驗證碼" type="button"/><script type="text/javascript" src="js/jquery-1.11.1.min.js"></script><script type="text/javascript">//獲取短信驗證碼var t=60;function TestGetCode(i){   if(t==0){        i.removeClass("grey-bg");        i.removeAttribute("disabled");        i.value="獲取短信驗證碼";        t=60;    }else{        i.setAttribute("disabled", true);         i.value="重新發送(" + t + ")";         t--;        $(this).addClass("grey-bg");        setTimeout(function(){TestGetCode(i)},1000);    }}</script></body></html>點擊其中一個還好,兩個都點就出問題了
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 1033 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號