function teXiao1() 
88 {
89 setTimeout("teXiao1()",10);
90
91 if(_i==0 && _j==0)
92 {
93 scrollrgb=randomRGB();
94 }
95 

解决方案 »

  1.   

    setTimeout() 方法用于在指定的毫秒数后调用函数或计算表达式
      

  2.   

    如function showtime()
    {
    var now = new Date();
    var h = now.getHours();
    var m = now.getMinutes();
    var s = now.getSeconds();
    var m2="";
    var s2="";
    if(m<10)m2="0"+m;
    else m2=m;
    if(s<10)s2="0"+s;
    else s2=s;
    var txt = h+":"+m2+":"+s2;
    var p = document.getElementById("txt_time");
    p.value="现在时刻:"+txt;

    setTimeout("showtime()",1000);
    }
      

  3.   

    为指定的操作设置超时值。http://msdn.microsoft.com/zh-cn/library/ms164398.aspx
      

  4.   

    function showtime()
    {
    var now = new Date();
    var h = now.getHours();
    var m = now.getMinutes();
    var s = now.getSeconds();
    var m2="";
    var s2="";
    if(m <10)m2="0"+m;
    else m2=m;
    if(s <10)s2="0"+s;
    else s2=s;
    var txt = h+":"+m2+":"+s2;
    var p = document.getElementById("txt_time");
    p.value="现在时刻:"+txt;setTimeout("showtime()",1000);clause;

    如果setTiemOut后面还有语句,走到setTimeOUt后,还会走后面么?
      

  5.   

    万一走到setTimeout用了20秒呢
      

  6.   

    会走。如:
    alert(1); 
    setTimeout("alert(2)", 1000); 
    alert(3); 是会走的,输出的
      

  7.   

    使用SetInterval和设定延时函数setTimeout  
    setTimeout   运用在延迟一段时间,再进行某项操作。 
    setTimeout( "function ",time)   设置一个超时对象 
    setInterval( "function ",time)   设置一个超时对象