Mojtaba Reyhani
Mojtaba Reyhani

Reputation: 457

How can I replace default "Slick Carousel" auto-generated Previous-Next arrows buttons manually?

Basically I need to use my own buttons rather than using the arrows that Slick Carousel plugin generates automatically.
I've made my own buttons which should toggle between slides. Take the following markup as an example:

<button type="button" class="slick-next left-arrow"></button>
<button type="button" class="slick-prev right-arrow"></button>

Upvotes: 1

Views: 244

Answers (1)

Alex
Alex

Reputation: 8695

There are options that plugin will use for its arrows. You have to pass your custom arrow to plugin's options.

var $prev = $('.slick-prev.right-arrow');
var $next = $('.slick-next.left-arrow');
$('.multiple-items').slick({
  prevArrow: $prev,
  nextArrow: $next
  // other option
});

jsfiddle

Upvotes: 1

Related Questions