Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add next prev button on slick carousel

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.

like image 892
Rasel mahmud Avatar asked Jun 08 '14 15:06

Rasel mahmud


1 Answers

Mine is same as above but maybe a little different, and I think is better to understand:

$('.responsive').slick({
   dots: true,
   prevArrow: $('.prev'),
   nextArrow: $('.next'),
   infinite: false,
   speed: 300,
   slidesToShow: 3,
   slidesToScroll: 1,
   autoplay: true,
   autoplaySpeed: 5000,
});


<div class="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</div>
<div class="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</div>
like image 139
Ilimkan Omurzakova Avatar answered Oct 06 '22 13:10

Ilimkan Omurzakova