title: Create an interval to change image in jQuery?
body: <p>I have a working script like this:</p>
  
  <pre><code>jQuery(document).ready(function(){
  
      $('.video-thumb img').bind('mouseover',function(){
          var new = $(this).attr('src').replace(/default.jpg/,'1.jpg');
          $(this).attr('src',new);
      }).bind('mouseout',function(){
          var default = $(this).attr('src').replace(/[0-9].jpg/,'default.jpg');
          $(this).attr('src',default);
      });
  
  });
  </code></pre>
  
  <p>Yeah, you guessed right. It's made to change YouTube's thumbnail on interval. However, I have no idea, how to create the interval. It now changes the thumbnail to 1.jpg, which is another thumbnail, but it should next change the image to 2.jpg in 1 second and so on.</p>
  
  <p>The whole snippet should probably be written from scratch. Advice?</p>
  
  <p>Hope you understood :-D</p>
  
  <p><strong>EDIT:</strong> I changed the variable-names from finnish words, I don't use them. Just in this example.</p>
  
  <p>Martti Laine</p>