title: Jquery, changing background image with timer
body: <p>I have two background images I am using for this website and I want them to change automatically every 5 seconds. Can someone please look at my jQuery code and tell me what I am doing wrong?</p>
  
  <pre><code>$(function() {
      var body = $(‘body’);
      var backgrounds = new Array(
          ‘url(images/hso-palmtree-background.jpg)’,
          ‘url(images/hso-boardwalk-background.jpg)’
      );
  
      var current = 0;
  
      function nextBackground() {
          body.css(
             ‘background’,
              backgrounds[current = ++current % backgrounds.length]
          );
  
          setTimeout(nextBackground, 5000);
      }
  
      setTimeout(nextBackground, 5000);
      body.css(‘background’, backgrounds[0]);
  });
  </code></pre>