setTimeout函數(shù)只是執(zhí)行一次?
為什么調(diào)用該函數(shù)可以實(shí)現(xiàn)高度持續(xù)減小呢?????
function adDown(){
oAd.style.display = "block";
oAd.style.height ?= h+"px";
if( h<maxH ){
? ? h+=step ? ?; //向下移動(dòng)
setTimeout(adDown,1);
}else{
setTimeout(adUp,3000); //停留時(shí)間自己適當(dāng)調(diào)整 1000 = 1秒
}
}
2016-11-27
是的,setTimeout是定時(shí)xx后執(zhí)行,setInterval是每個(gè)多長(zhǎng)時(shí)間循環(huán)執(zhí)行
2016-11-30
不客氣,相互學(xué)習(xí)