第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

在我原來代碼上,把js定時(shí)器改成用for循環(huán)優(yōu)化

在我原來代碼上,把js定時(shí)器改成用for循環(huán)優(yōu)化

林夕plus 2017-03-30 08:50:48
<!DOCTYPE?html> <html> <head?lang="en"> ????<meta?charset="UTF-8"> ????<title></title> </head> <script> ?window.onload=function(){ ?var?btn1?=?document.getElementById("btn1"); ?var?btn2?=?document.getElementById("btn2"); ?var?btn3?=?document.getElementById("btn3"); ?var?btn4?=?document.getElementById("btn4"); ?var?btn5?=?document.getElementById("btn5"); //?? ?setTimeout(time1,2000); ?function?time1(){ //???????? ?btn1.style.backgroundColor?=?"red"; ?btn2.style.backgroundColor?=?"#000"; ?btn3.style.backgroundColor?=?"#000"; ?btn4.style.backgroundColor?=?"#000"; ?btn5.style.backgroundColor?=?"#000"; ????????} ?setTimeout(time2,4000); ?function?time2(){ ?btn1.style.backgroundColor?=?"#000"; ?btn2.style.backgroundColor?=?"red"; ?btn3.style.backgroundColor?=?"#000"; ?btn4.style.backgroundColor?=?"#000"; ?btn5.style.backgroundColor?=?"#000"; ????????} ?setTimeout(time3,6000); ?function?time3(){ ?btn1.style.backgroundColor?=?"#000"; ?btn2.style.backgroundColor?=?"#000"; ?btn3.style.backgroundColor?=?"red"; ?btn4.style.backgroundColor?=?"#000"; ?btn5.style.backgroundColor?=?"#000"; ????????} ?setTimeout(time4,8000); ?function?time4(){ ?btn1.style.backgroundColor?=?"#000"; ?btn2.style.backgroundColor?=?"#000"; ?btn3.style.backgroundColor?=?"#000"; ?btn4.style.backgroundColor?=?"red"; ?btn5.style.backgroundColor?=?"#000"; ????????} ?setTimeout(time5,10000); ?function?time5(){ ?btn1.style.backgroundColor?=?"#000"; ?btn2.style.backgroundColor?=?"#000"; ?btn3.style.backgroundColor?=?"#000"; ?btn4.style.backgroundColor?=?"#000"; ?btn5.style.backgroundColor?=?"red"; ????????} ????} </script> <style> ?li{ ????????width:?100px; ?height:?100px; ?background-color:?#000; ?} </style> <body> <div> ????<ol> ????????<li?id="btn1"></li> ????????<li?id="btn2"></li> ????????<li?id="btn3"></li> ????????<li?id="btn4"></li> ????????<li?id="btn5"></li> ????</ol> </div> </body> </html>
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1855 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號