title: How do I set auto timer to content slideshow?
body: <p>I am using the following as a content slider but unsure as to instead have the click the button to play the slides through but wanting to take that away and for the slides to go go through on load?</p>
  
  <p><a href="http://jsfiddle.net/cbh4w9tt/" rel="nofollow">DEMO</a></p>
  
  <pre><code>$(document).ready(function() {
  
  var height = 300,
      width = 600,
  
      tabs = 3,
  
      $tabs = $('.tab'),
      contentNum = 1,
  
      delay = 2000, // time in milliseconds to pause between tabs
      timer;
  
  $('.play').click(function(){
      var $t = $(this);
      if ($t.hasClass('playing')) {
          // stop
          clearTimeout(timer);
          $t.removeClass('playing').html('play');
      } else {
          // play
          timer = setInterval(function(){
              contentNum++; // change to contentNum--; to go left
              if (contentNum &gt; tabs){ contentNum = 1; } // loop right
              if (contentNum &lt; 1) { contentNum = tabs; } // loop left
              $tabs.eq(contentNum-1).find('a').trigger('click');
          }, delay);
          $t.addClass('playing').html('stop');
      }
  });
  
  $('.main_inner').css({
      width: tabs * width
  });
  
  $('a.tab_link').click(function() {
  
      $tabs.filter('.active').removeClass('active');
      $(this).parent().addClass('active');
  
      // make sure contentNum is a number and not a string
      contentNum = parseInt( $(this).attr('rel'), 10 );
  
      $('.main_inner').animate({
          marginLeft: '-' + (width * contentNum - width)
      }, 600);
  
      return false;
  
  });
  
  
  });
  </code></pre>