A
A
Alexander2020-01-03 05:06:00
JavaScript
Alexander, 2020-01-03 05:06:00

How to set custom button in slick?

How to set custom button in slick?

in js i write

$(document).ready(function(){
    $('.block-slick').slick({
        prevArrow: $('.prev'),
        nextArrow: $('.next')
    });
});


in html I created my own button with my own styles, but nothing works.

<div class=".prev">Левая кнопка</div>
<div class=".next">Правая кнопка</div>


I know that in js you can pass
prevArrow: '<div class="block__arrow--left"><</div>',
nextArrow: '<div class="block__arrow--right">></div>'


but in this case, the buttons appear before and after the slide, and I need to be able to position the buttons anywhere on the page.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Smirnov, 2020-01-03
@Sentim

Try like this:
js

$(document).ready(function(){
    $('.block-slick').slick({
        prevArrow: '.prev',
        nextArrow: '.next'
    });
});

html
<div class="prev">Левая кнопка</div>
<div class="next">Правая кнопка</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question