title: jQuery pause function on hover?
body: <p>I have a jQuery/JS function that is using <code>setInterval</code> to loop through some image slides I have.  It just flips through every 5 seconds...</p>
  
  <p>Now I want it to pause if my mouse is hovered over it.  How do I go about doing that on the setInterval function?</p>
  
  <pre><code>var current = 1;
  
  function autoAdvance() {
      if (current == -1) return false;
  
      jQuery('#slide_menu ul li a').eq(current % jQuery('#slide_menu ul li a').length).trigger('click', [true]);
      current++;
  }
  
  // The number of seconds that the slider will auto-advance in:
  var changeEvery = jQuery(".interval").val();
  if (changeEvery &lt;= 0) {
      changeEvery = 10;
  }
  var itvl = setInterval(function () {
      autoAdvance()
  }, changeEvery * 1000);
  </code></pre>