title: Slick Slider - How to Remove Specific Slides On Click
body: <p>I am trying to add functionality to slick slider where when you click on a slide it will remove it from the slider.</p>
  
  <p>I looked at the documentation on <a href="http://kenwheeler.github.io/slick/" rel="nofollow noreferrer">Slick Sliders</a> website and it shows how to add/remove slides, but that only works for the last slide in the slider.</p>
  
  <p>I am trying to make it work so you can remove a specific slide based on which one is clicked. </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="slider add-remove slick-initialized slick-slider"&gt;
      &lt;div aria-live="polite" class="slick-list draggable"&gt;
          &lt;div class="slick-track" style="opacity: 1; width: 80px; transform: translate3d(0px, 0px, 0px);" role="listbox"&gt;
              &lt;div class="slick-slide slick-current slick-active" data-slick-index="0" aria-hidden="false" style="width: 80px;" tabindex="-1" role="option" aria-describedby="slick-slide100"&gt;
                  &lt;h3&gt;1&lt;/h3&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;a href="javascript:void(0)" class="button js-remove-slide"&gt;Remove Slide&lt;/a&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$('.js-remove-slide').on('click', function() {
    $('.add-remove').slick('slickRemove',slideIndex - 1);
    if (slideIndex !== 0){
      slideIndex--;
    }
  });
  </code></pre>
  
  <p>EDIT: I added some more code to show how it is set up for <a href="http://kenwheeler.github.io/slick/" rel="nofollow noreferrer">Slick slider HERE</a> this is set up to remove the last slide in the slider. </p>
  
  <p>I'm trying to set it up so when the remove button is clicked on a slide that slide will be removed from the slider. The snippet I grabbed from the Slick Slider website only removes the last slide in the slider. So I'm trying to figure out how to remove a specific slide on click.</p>
  
  <p><a href="https://i.stack.imgur.com/JbC7x.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JbC7x.jpg" alt="image"></a></p>