你写的不对啊。 //alert(index); if(index<=step) timer=setTimeout("TransIn("+rootMenu+","+"index"+")", time/step);