title: jQuery play/pause jQuery function
body: <p>What I'm trying to do is play and pause a function ie press a button to start a function press a button to pause so on. I am not entirely sure how this can be done I have tried .live() and .die() but they don't work.</p>
  
  <p><a href="http://jsfiddle.net/Ub3wk/2/" rel="nofollow"><strong>Fiddle</strong></a></p>
  
  <p>I have the HTML below</p>
  
  <pre><code>&lt;button class="play"&gt;play&lt;/button&gt;
  &lt;button class="pause"&gt;pause&lt;/button&gt;
  &lt;div class="divafter"&gt;&lt;/div&gt;​
  </code></pre>
  
  <p>and the jQuery which I'm not entirely sure what .die() does but on the jsfiddle seems to speed up the interval time.</p>
  
  <pre><code>(function($){
    playing = function() {
  window.setInterval(function() {
      $(".divafter").after("playing &lt;br/&gt;");
  }, 500);
  };
  })(jQuery);
  $(".play").click(function(){
      playing().live();
  });
  $(".pause").click(function(){
      playing().die();
  });​
  </code></pre>