title: how to stop loop on this slider
body: <p>I'm using this slider to my site. everything is going fine. It automatically plays slide from first to last and after completeing the first cycle it comes to first slide again. I want to stop the slide cycle.
  I want to stop auto loop on this slider.
  please help me.
  I've attachted my js code.
  <a href="http://codyhouse.co/gem/hero-slider/" rel="nofollow">http://codyhouse.co/gem/hero-slider/</a></p>
  
  <pre><code>    jQuery(document).ready(function($){
  var slidesWrapper = $('.cd-hero-slider');
  if ( slidesWrapper.length &gt; 0 ) {
      var primaryNav = $('.cd-primary-nav'),
          sliderNav = $('.cd-slider-nav'),
          navigationMarker = $('.cd-marker'),
          slidesNumber = slidesWrapper.children('li').length,
          visibleSlidePosition = 0,
          autoPlayId,
          autoPlayDelay = 5000;
  
      uploadVideo(slidesWrapper);
  
      setAutoplay(slidesWrapper, slidesNumber, autoPlayDelay);
  
      primaryNav.on('click', function(event){
          if($(event.target).is('.cd-primary-nav')) $(this).children('ul').toggleClass('is-visible');
      });
  
      sliderNav.on('click', 'li', function(event){
          event.preventDefault();
          var selectedItem = $(this);
          if(!selectedItem.hasClass('selected')) {
              var selectedPosition = selectedItem.index(),
                  activePosition = slidesWrapper.find('li.selected').index();
  
              if( activePosition &lt; selectedPosition) {
                  nextSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, selectedPosition);
              } else {
                  prevSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, selectedPosition);
              }
  
              visibleSlidePosition = selectedPosition;
  
              updateSliderNavigation(sliderNav, selectedPosition);
              updateNavigationMarker(navigationMarker, selectedPosition+1);
              setAutoplay(slidesWrapper, slidesNumber, autoPlayDelay);
          }
      });
  }
  
  function nextSlide(visibleSlide, container, pagination, n){
      visibleSlide.removeClass('selected from-left from-right').addClass('is-moving').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
          visibleSlide.removeClass('is-moving');
      });
  
      container.children('li').eq(n).addClass('selected from-right').prevAll().addClass('move-left');
      checkVideo(visibleSlide, container, n);
  }
  
  function prevSlide(visibleSlide, container, pagination, n){
      visibleSlide.removeClass('selected from-left from-right').addClass('is-moving').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
          visibleSlide.removeClass('is-moving');
      });
  
      container.children('li').eq(n).addClass('selected from-left').removeClass('move-left').nextAll().removeClass('move-left');
      checkVideo(visibleSlide, container, n);
  }
  
  function updateSliderNavigation(pagination, n) {
      var navigationDot = pagination.find('.selected');
      navigationDot.removeClass('selected');
      pagination.find('li').eq(n).addClass('selected');
  }
  
  function setAutoplay(wrapper, length, delay) {
      if(wrapper.hasClass('autoplay')) {
          clearInterval(autoPlayId);
          autoPlayId = window.setInterval(function(){autoplaySlider(length)}, delay);
      }
  }
  
  function autoplaySlider(length) {
      if( visibleSlidePosition &lt; length - 1) {
          nextSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, visibleSlidePosition + 1);
          visibleSlidePosition +=1;
      } else {
          prevSlide(slidesWrapper.find('.selected'), slidesWrapper, sliderNav, 0);
          visibleSlidePosition = 0;
      }
      updateNavigationMarker(navigationMarker, visibleSlidePosition+1);
      updateSliderNavigation(sliderNav, visibleSlidePosition);
  }
  
  function uploadVideo(container) {
      container.find('.cd-bg-video-wrapper').each(function(){
          var videoWrapper = $(this);
          if( videoWrapper.is(':visible') ) {
              var videoUrl = videoWrapper.data('video'),
                  video = $('&lt;video loop&gt;&lt;source src="'+videoUrl+'.mp4" type="video/mp4" /&gt;&lt;source src="'+videoUrl+'.webm" type="video/webm" /&gt;&lt;/video&gt;');
              video.appendTo(videoWrapper);
              if(videoWrapper.parent('.cd-bg-video.selected').length &gt; 0) video.get(0).play();
          }
      });
  }
  
  function checkVideo(hiddenSlide, container, n) {
      var hiddenVideo = hiddenSlide.find('video');
      if( hiddenVideo.length &gt; 0 ) hiddenVideo.get(0).pause();
  
      var visibleVideo = container.children('li').eq(n).find('video');
      if( visibleVideo.length &gt; 0 ) visibleVideo.get(0).play();
  }
  
  function updateNavigationMarker(marker, n) {
      marker.removeClassPrefix('item').addClass('item-'+n);
  }
  
  $.fn.removeClassPrefix = function(prefix) {
      this.each(function(i, el) {
          var classes = el.className.split(" ").filter(function(c) {
              return c.lastIndexOf(prefix, 0) !== 0;
          });
          el.className = $.trim(classes.join(" "));
      });
      return this;
  };
  </code></pre>
  
  <p>});</p>
  
  <pre><code>&lt;section class="cd-hero"&gt;
      &lt;ul class="cd-hero-slider autoplay"&gt;
          &lt;!-- &lt;li class="selected"&gt;
              &lt;div class="cd-full-width"&gt;
                  &lt;h2&gt;SLider Title 1&lt;/h2&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet.&lt;/p&gt;
                  &lt;a href="#" class="cd-btn"&gt;Article &amp;amp; Download&lt;/a&gt;
              &lt;/div&gt;
          &lt;/li&gt; --&gt;
  
          &lt;li class="selected"&gt;
              &lt;div class="cd-half-width"&gt;
                  &lt;!-- &lt;h2&gt;Slide title here&lt;/h2&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. In consequatur cumque natus!&lt;/p&gt;
                  &lt;a href="#0" class="cd-btn"&gt;Start&lt;/a&gt;
                  &lt;a href="#0" class="cd-btn secondary"&gt;Learn More&lt;/a&gt; --&gt;
                  &lt;img src="img/slider-logo-1.png" alt=""&gt;
                  &lt;img src="img/slider-logo-2.png" alt=""&gt;
                  &lt;img src="img/slider-logo-3.png" alt=""&gt;
              &lt;/div&gt;
  
              &lt;div class="cd-half-width cd-img-container"&gt;
                  &lt;img src="img/led.jpg" alt="tech 1"&gt;
              &lt;/div&gt; 
          &lt;/li&gt;
  
          &lt;!-- &lt;li&gt;
              &lt;div class="cd-half-width cd-img-container"&gt;
                  &lt;img src="assets/tech-2.jpg" alt="tech 2"&gt;
              &lt;/div&gt; 
  
              &lt;div class="cd-half-width"&gt;
                  &lt;h2&gt;Slide title here&lt;/h2&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. In consequatur cumque natus!&lt;/p&gt;
                  &lt;a href="#0" class="cd-btn"&gt;Start&lt;/a&gt;
                  &lt;a href="#0" class="cd-btn secondary"&gt;Learn More&lt;/a&gt;
              &lt;/div&gt; 
  
          &lt;/li&gt; --&gt;
  
          &lt;li class="cd-bg-video"&gt;
              &lt;div class="cd-full-width"&gt;
                  &lt;h2&gt;Slide title here&lt;/h2&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi, explicabo.&lt;/p&gt;
                  &lt;a href="#0" class="cd-btn"&gt;Learn more&lt;/a&gt;
              &lt;/div&gt; &lt;!-- .cd-full-width --&gt;
  
              &lt;div class="cd-bg-video-wrapper" data-video="assets/video/video"&gt;
                  &lt;!-- video element will be loaded using jQuery --&gt;
              &lt;/div&gt; &lt;!-- .cd-bg-video-wrapper --&gt;
          &lt;/li&gt;
  
          &lt;li&gt;
              &lt;div class="cd-full-width"&gt;
                  &lt;h2&gt;wow&lt;/h2&gt;
                  &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi, explicabo.&lt;/p&gt;
                  &lt;a href="#0" class="cd-btn"&gt;Start&lt;/a&gt;
                  &lt;a href="#0" class="cd-btn secondary"&gt;Learn More&lt;/a&gt;
              &lt;/div&gt; &lt;!-- .cd-full-width --&gt;
          &lt;/li&gt;
      &lt;/ul&gt; &lt;!-- .cd-hero-slider --&gt;
  
      &lt;div class="cd-slider-nav"&gt;
          &lt;nav&gt;
              &lt;span class="cd-marker item-1"&gt;&lt;/span&gt;
  
              &lt;ul&gt;
                  &lt;li class="selected"&gt;&lt;a href="#0"&gt;Intro&lt;/a&gt;&lt;/li&gt;
                  &lt;!-- &lt;li&gt;&lt;a href="#0"&gt;Tech 1&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#0"&gt;Tech 2&lt;/a&gt;&lt;/li&gt; --&gt;
                  &lt;li&gt;&lt;a href="#0"&gt;Video&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#0"&gt;Image&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/nav&gt; 
      &lt;/div&gt; &lt;!-- .cd-slider-nav --&gt;
  &lt;/section&gt;
  </code></pre>