Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add custom buttons on Slick Carousel

How do I apply custom prev and next buttons to slick carousel? I have tried a background image on the .slick-prev and .slick-next css classes. I have also tried adding a new class as per the documentation but the arrows disappeared completely:

<script type="text/javascript"> $('.big-image').slick({   dots: false,   infinite: true,   speed: 300,   slidesToShow: 1,   centerMode: true,   variableWidth: true,   nextArrow: '.next_caro',   prevArrow: '.previous_caro' }); </script> 

Any pointers would be appreciated.

like image 206
rorykoehler Avatar asked Mar 13 '15 23:03

rorykoehler


People also ask

How do you add next and old buttons on slick slider?

nextArrow - Next Allows you to select a node or customize the HTML for the "Next" arrow. prevArrow - Previous Allows you to select a node or customize the HTML for the "Previous" arrow. you can find the above nextArrow and prevArrow json properties under the _. defaults json object inside the un-minified slick.

How do I add arrows to slick carousel?

CodePen Embed - slick-arrows. $(function(){ $("#slider"). slick({ speed: 1000, dots: true, prevArrow: '<button class="slide-arrow prev-arrow"></button>', nextArrow: '<button class="slide-arrow next-arrow"></button>' }); });

What is carousel in slick?

The carousel is a slideshow for cycling through a series of content, built with CSS 3D transforms and a bit of JavaScript. It works with a series of images, text, or custom markup. It also includes support for previous/next controls and indicators. Official documentation.


1 Answers

I know this is an old question, but maybe I can be of help to someone, bc this also stumped me until I read the documentation a bit more:

prevArrow string (html|jQuery selector) | object (DOM node|jQuery object) Previous Allows you to select a node or customize the HTML for the "Previous" arrow.

nextArrow string (html|jQuery selector) | object (DOM node|jQuery object) Next Allows you to select a node or customize the HTML for the "Next" arrow.

this is how i changed my buttons.. worked perfectly.

  $('.carousel-content').slick({       prevArrow:"<img class='a-left control-c prev slick-prev' src='../images/shoe_story/arrow-left.png'>",       nextArrow:"<img class='a-right control-c next slick-next' src='../images/shoe_story/arrow-right.png'>"   }); 
like image 169
tallgirltaadaa Avatar answered Sep 28 '22 13:09

tallgirltaadaa