jQuery on hover endless animation of 2 images
<p>There's example: <a href="http://www.jquery4u.com/jquery-functions/setinterval-example/#.UHW6_IYY18E" rel="nofollow">http://www.jquery4u.com/jquery-functions/setinterval-example/#.UHW6_IYY18E</a>
Hover over RSS feedburner image - it will shake. </p>

<p>In my case i have 2 images:
non-hover.png, hover.png. </p>

<p>When a:link - it shows as background non-hover.png, when you hover it shows hover.png and with interval of 3 seconds it switches to non-hover.png (while cursor is still on this link), like endless loop, you hover and it switches non-hover.png to hover.png with 3 seconds interval. </p>

<p>I want jquery to switch between the two images every three seconds when the cursor is over the anchor.</p>

<p><strong>SOLUTION.</strong></p>

<pre><code>    $(document).ready(function() {

      function pizdec() {
        setTimeout(function(){ $('.istina').css('background-image','url("&lt;?php print $base_path . $directory ?&gt;/img/istina.png")'); }, 500);
        $('.istina').css('background-image', 'url("&lt;?php print $base_path . $directory ?&gt;/img/istina-hover.png")');
      }

  var IntervalID;

  $('.istina').hover(function() {
    pizdec();
    IntervalID = setInterval(pizdec, 1000)
  }, function() {
      clearInterval(IntervalID);
    }
  )

});
</code></pre>
