Add next prev button on slick carousel

Rasel mahmud picture Rasel mahmud · Jun 8, 2014 · Viewed 57.4k times · Source

Recently I have added Slick carousel on my project.

Reading there document i have seen there is a method slick Prev() and slick Next().

But I am asking you how do I use this method. I have try this long time but I actually I can't understand how to use this with html button.

$('button.next').click(function() {
    $(this).slickPrev();
});

I have tried this way.

Answer

Anima-t3d picture Anima-t3d · Jun 8, 2014
$('button.next').click(function(){
    $("#yourid").slickPrev();
});

Try changing this to "#yourid" where the yourid is the id of the slider.


As of version 1.4 and later, use:

$('button.next').click(function(){
    $("#yourid").slick('slickPrev');
});