課程
/前端開發(fā)
/JavaScript
/Tab選項(xiàng)卡切換效果
為什么運(yùn)行不了,經(jīng)常這樣和別人的代碼一模一樣也運(yùn)行不了
2015-11-19
源自:Tab選項(xiàng)卡切換效果 3-4
正在回答
<!doctype html>
<html>
<head>
? ? <meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
window.onload=function(){
? ?var send=document.getElementById('send'),
? ? ? ?times=60,
? ? ? ?timer=null;
send.onclick=function(){
? //alert(0);
? timer=setInterval(autoCount,1000);
}
? ? ? ?function autoCount(){
? ? ? ? ? ?send.value=times+"秒后重試";
? ? ? ? ? ?send.disabled="false";
? ? ? ? ? ?times--;
? ? ? ? ? ?if(times<0){
? ? ? ? ? ? ? ?clearInterval(timer);
? ? ? ? ? ? ? ?autoStop();
? ? ? ? ? ?}
? ? ? ?} ??
? ? ? ?function autoStop(){
? ? ? ? ? ?send.value="發(fā)送驗(yàn)證碼";
? ? ? ? ? ?send.removeAttribute("disabled");
? ? ? ? ? ?times=60;
? ? ? ?}
? ?}
</script>
</head>
<body>
<input type="button" id="send" value="發(fā)送驗(yàn)證碼">
</body>
</html>
少個(gè)“}”大括號(hào)
哎 ?自己老范低級(jí)錯(cuò)誤
少個(gè)“}”大括號(hào)吧
舉報(bào)
本課程詳細(xì)介紹網(wǎng)頁頁面中最流行常用的tab切換效果
1 回答代碼運(yùn)行不出來
2 回答這樣給變量賦值為什么不行
1 回答我是這樣寫的 ,和老師講的代碼有點(diǎn)不一樣,親們看看這樣寫對(duì)不對(duì)?
3 回答為什么導(dǎo)入延時(shí)切換的代碼以后網(wǎng)頁內(nèi)容除了標(biāo)題都不見了?用老師的代碼也是這樣的。
1 回答為什么上節(jié)講的時(shí)候可以timer = setInterval(autoPlay(), 2000);這樣寫,而我這樣寫就只能執(zhí)行一次,就是1秒后沒不執(zhí)行了
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2015-11-19
<!doctype html>
<html>
<head>
? ? <meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
window.onload=function(){
? ?var send=document.getElementById('send'),
? ? ? ?times=60,
? ? ? ?timer=null;
send.onclick=function(){
? //alert(0);
? timer=setInterval(autoCount,1000);
}
? ? ? ?function autoCount(){
? ? ? ? ? ?send.value=times+"秒后重試";
? ? ? ? ? ?send.disabled="false";
? ? ? ? ? ?times--;
? ? ? ? ? ?if(times<0){
? ? ? ? ? ? ? ?clearInterval(timer);
? ? ? ? ? ? ? ?autoStop();
? ? ? ? ? ?}
? ? ? ?} ??
? ? ? ?function autoStop(){
? ? ? ? ? ?send.value="發(fā)送驗(yàn)證碼";
? ? ? ? ? ?send.removeAttribute("disabled");
? ? ? ? ? ?times=60;
? ? ? ?}
? ?}
</script>
</head>
<body>
<input type="button" id="send" value="發(fā)送驗(yàn)證碼">
</body>
</html>
2015-12-15
少個(gè)“}”大括號(hào)
2015-11-20
哎 ?自己老范低級(jí)錯(cuò)誤
2015-11-19
少個(gè)“}”大括號(hào)吧