Run function in infinite loop
        Posted  
        
            by zac
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by zac
        
        
        
        Published on 2010-05-30T04:33:57Z
        Indexed on 
            2010/05/30
            9:12 UTC
        
        
        Read the original article
        Hit count: 360
        
I am creating a background color animation with jQuery and the color animation plugin http://plugins.jquery.com/project/color
How do I have a function stay in a loop repeating itself each time it has finished running? I tried this but it did not work :
 function colorLoop(){
  $("#window")
     .animate({ backgroundColor: "orange" }, 11000)
  .animate({ backgroundColor: "violet" }, 1000)
  .animate({ backgroundColor: "red" }, 1000, colorLoop);
  };
© Stack Overflow or respective owner