打地鼠上升下降的效果
灰太狼上升的效果
function htlTop(){
var dsqHtlTop = setInterval(function(){
htlNum++;
if(htlNum==5){
clearInterval(dsqHtlTop);
htlDow();
}
htlImg.src = "./img/h"+htlNum+".png";
console.log(htlNum);
},120);
}
//灰太狼下降动画
function htlDow(){
var dsqHtlDow = setInterval(function(){
htlNum--;
if(htlNum==0){
clearInterval(dsqHtlDow);
box2.removeChild(htlImg);
}
htlImg.src = "./img/h"+htlNum+".png";
console.log(htlNum);
},100);
}