title: setInterval to change background from function
body: <p>Hello this is based very closely on:</p>
  
  <p><a href="https://stackoverflow.com/questions/5977837/jquery-loop-through-different-backgrounds">jquery loop through different backgrounds</a></p>
  
  <p>This solution did work for me, however I do not want the background's to change on document ready - they should be triggered by a function. For some reason this makes the backgrounds change too fast, they flicker 3 at once so it looks like the loop is over running somewhere:</p>
  
  <pre><code>function run()
  {
  // Set multicolour backgrounds
  window.setInterval( multicolour(), 3000);
  }
  
  var colour = 0;
  var colours = Array('', 'pink', 'red', 'green', 'light');
  
  function multicolour()
  {
      colour = (colour+1) % colours.length ;
      $('body').attr('id', colours[colour]);
      console.log(colour);
  }
  </code></pre>
  
  <p>FYI the console log shows the colour flickering 3 times every 3 seconds instead of changing once every 3 seconds. Help?</p>