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 ha
A variation on the answer by @tallgirltaadaa , draw your own button in the shape of a caret:
var a = $('.MyCarouselContainer').slick({
prevArrow: '',
nextArrow: ''
});
function drawNextPreviousArrows(strokeColor) {
var c = $(".prevArrowCanvas")[0];
var ctx = c.getContext("2d");
ctx.clearRect(0, 0, c.width, c.height);
ctx.moveTo(15, 0);
ctx.lineTo(0, 25);
ctx.lineTo(15, 50);
ctx.lineWidth = 2;
ctx.strokeStyle = strokeColor;
ctx.stroke();
var c = $(".nextArrowCanvas")[0];
var ctx = c.getContext("2d");
ctx.clearRect(0, 0, c.width, c.height);
ctx.moveTo(0, 0);
ctx.lineTo(15, 25);
ctx.lineTo(0, 50);
ctx.lineWidth = 2;
ctx.strokeStyle = strokeColor;
ctx.stroke();
}
drawNextPreviousArrows("#cccccc");
then add the css
.slick-prev, .slick-next
height: 50px;s
}