title: Swing element animation on hover
body: <p>My goal is to swing an item only on hover, by using CSS and some jQuery (and of course should stop on mouse out).</p>
  
  <p>Searching the internet I found the code to swing an element when the document is ready (<a href="http://jsfiddle.net/PFH9c/" rel="nofollow">complete jsFiddle</a>). </p>
  
  <pre><code>$(document).ready(function() {
  
      function swing(){
          $('.swing').toggleClass('right');
          setTimeout(swing, 1000);
      }
      swing();
  });
  </code></pre>
  
  <p>I tried using the .hover() method, but seems to not work.
  How can I fix this minor problem?</p>