Can't get slickGoTo working for custom slick navigation

Seth DeHaan picture Seth DeHaan · Feb 6, 2015 · Viewed 8.7k times · Source

Trying to use slick carousel and use my own custom icons for navigation instead of the default thoughts. I thought the best way to do this would be to set up my own list and use slickGoTo, but I can't get it to work.

$(document).ready(function(){

    $('.rps-slider').slick({
      infinite: true,
      arrows: true,
      dots:true
    });

    $(".slick-nav li a").click(function(e){
      var slideIndex = $(this).index();
      $( ".rps-slider" ).slickGoTo(parseInt(slideIndex));
    });

  });

jsfiddle here: http://jsfiddle.net/r7vjy7as/

Answer

faron picture faron · Feb 11, 2015

Use $( ".rps-slider" ).slick('slickGoTo', parseInt(slideIndex));