setTimeout里面第一行写alert为什么不执行?
function animate(ball,distence,cb){
setTimeout(function(){
alert(1) //为什么alert不执行?
var marginLeft = parseInt(ball.style.marginLeft,10);
if(marginLeft === distence){
cb && cb();
}else{
if(marginLeft < distence){
marginLeft++;
}else{
marginLeft--
}
ball.style.marginLeft = marginLeft+'px';
animate(ball,distence,cb);
}
},13)
}