title: jQuery: Stop and start "setInterval"
body: <p>I have a slideshow on my website but there is a problem with in. <br /></p>
  
  <p><strong>Here, my JS:</strong></p>
  
  <pre><code>var size_ini = 1;
  $(document).ready(function() {
      setInterval('$("#next").click()',10000)
      $("#next").click(function() {
          if(size_ini &lt; 3);
          size_ini++;
          else
          size_ini = 1
          $(".sample").hide();
          $("#id" + size_ini).show();
          $(".comment" + size_ini).show();
          $(".comment_description" + size_ini).show();
      });
      $("#prev").click(function() {
          if(size_ini &gt; 1)
          size_ini--;
          else
          size_ini = 3;
          $(".sample").hide();
          $("#id" + size_ini).show();
          $(".comment" + size_ini).show();
          $(".comment_description" + size_ini).show();
      });
  });
  </code></pre>
  
  <p>As you can see I have a Timer of 10 sec. for slide. I have a previous and a next button. So when i clicked on one of the button the timer should stop and starts again. I have tried "clearInterval" but this doesn't work.<br/></p>
  
  <p>Can anyone tell how this works.</p>
  
  <p>Here is <a href="http://jsfiddle.net/jLm7Q/1/" rel="noreferrer"><strong>FIDDLE</strong></a>.</p>