Using setInvernal to call a query function every few seconds?
<p>Really easy one here, I'm sure - I'm a beginner who's struggling to integrate setInterval into my jQuery. I currently have this function, which rotates two images upon clicking them. I want this to happen automatically (every few seconds), and can't seem to find the right way to use setInterval.</p>

<p>Could anyone point me in the right direction? Thanks a lot for any help.   </p>

<p>Philip </p>

<pre><code>$(document).ready(function(){
$("#spinitemholder1 .sponsorFlipphil1 img").click(function () {
          $(this).animate({ "width": "0px", "margin-left": "135px" }, 500, function () {
              $(this).parent().hide();
              $(this).width(0);
              $("#spinitemholder1 .sponsorFlipphil2 img").animate({ "width": "271px", "margin-left": "0px" });
              $("#spinitemholder1 .sponsorFlipphil2").show();
          });
      });
      $("#spinitemholder2 .sponsorFlipphil2 img").click(function () {
          $(this).animate({ "width": "0px", "margin-left": "135px" }, 500, function () {
              $(this).parent().hide();
              $(this).width(0);
              $("#spinitemholder1 .sponsorFlipphil1 img").animate({ "width": "271px", "margin-left": "0px" });
              $("#spinitemholder1 .sponsorFlipphil1").show();
          });
      });

});
</code></pre>
