title: Add autoplay function to simple jQuery slider
body: <p>My current slider functions perfect, and also has a working pagination (paginated dots, active state, and control) but I just want to add <strong>ONE new feature without breaking anything</strong>:</p>
  
  <p><strong>The ability for my slider to autoplay on page load.</strong></p>
  
  <p>Any suggestions, greatly appreciated.</p>
  
  <p><strong>HTML / Markup:</strong></p>
  
  <pre><code>&lt;div class="allslideshow"&gt;
      &lt;div class="slideshow-wrapper"&gt;
          &lt;div class="slide" id="s1"&gt;&lt;/div&gt;
          &lt;div class="slide" id="s2"&gt;&lt;/div&gt;
          &lt;div class="slide" id="s3"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="slideshow-nav"&gt; &lt;a href="#s1"&gt;•&lt;/a&gt;
   &lt;a href="#s2"&gt;•&lt;/a&gt;
   &lt;a href="#s3"&gt;•&lt;/a&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>jQuery(document).ready(function($) {
  var Slideshow = {
      paginate: function () {
          var slides = $('div.slide', '.allslideshow'),
              total = slides.length;
          $('.slideshow-nav-total').text(total);
          slides.each(function (i) {
              $(this).data('index', i + 1);
          });
      },
      navigate: function () {
          $('a', '.slideshow-nav').click(function (e) {
              e.preventDefault();
              var $a = $(this);
              var slide = $($a.attr('href'));
              var wrapper = $('.slideshow-wrapper');
              wrapper.animate({
                  left: -slide.position().left
              }, 500, 'linear', function () {
                  $('.slideshow-nav-current').text(slide.data('index'));
                  $a.addClass('active').siblings('a').removeClass('active');
              });
  
          });
      },
      init: function () {
          this.paginate();
          this.navigate();
      }
  };
  $(function () {
      Slideshow.init();
      });
  });
  </code></pre>
  
  <p><strong>Attempt:</strong></p>
  
  <pre><code>// autoplay: function () {
  //      .ready(function) { 
  //         e.preventDefault();
  //         var $a = $(this);
  //         var slide = $($a.attr('href'));
  //         var wrapper = $('.slideshow-wrapper');
  //         wrapper.animate({
  //             left: -slide.position().left
  //         }, 300, 'linear', function () {
  //             $('.slideshow-nav-current').text(slide.data('index'));
  //             $a.addClass('active').siblings('a').removeClass('active');
  //          });
  
  //     });
  // },
  </code></pre>