title: Implementing Autoplay on glider.js
body: <p>So I'm working with glider.js (<a href="https://nickpiscitelli.github.io/Glider.js/" rel="nofollow noreferrer">https://nickpiscitelli.github.io/Glider.js/</a>) on my website for handling slides, because I really want to keep it minimal (I know there are other sliders out there, but glider.js is the lightest). However, I really need the autoplay function, but I can't seem to be able to make it work (I don't really know my way around JS, I just copy code snippets for things I need)</p>
  
  <p>I found some code for an autoplay, it looks like this:</p>
  
  <pre><code>function sliderAuto(slider, miliseconds) {
   slider.isLastSlide = function() {
     return slider.page &gt;= slider.dots.childElementCount - 1;
   }
  
   var slide = function() {
     slider.slideTimeout = setTimeout(function() {
       function slideTo() {
         return slider.isLastSlide() ? 0 : slider.page + 1;
       }
  
       slider.scrollItem(slideTo(), true);
     }, miliseconds);
   }
  
   slider.ele.addEventListener('glider-animated', function(event) {
     window.clearInterval(slider.slideTimeout);
     slide();
   });
  
   slide();
  }
  </code></pre>
  
  <p>But I don't know how to activate it, to make it work. I know I should pass the parameters to "slider" and "miliseconds", but I don't know what exactly should I pass, should I set a special class to each slide, and pass that class? Let's say my html is the following:</p>
  
  <pre><code>&lt;div class="glider-contain"&gt;
    &lt;div class="glider"&gt;
      &lt;div&gt;your content here&lt;/div&gt;
      &lt;div&gt;your content here&lt;/div&gt;
      &lt;div&gt;your content here&lt;/div&gt;
      &lt;div&gt;your content here&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>How do I make the autoplay work? Thanks!</p>