R
R
rinatoptimus2016-10-21 13:58:33
JavaScript
rinatoptimus, 2016-10-21 13:58:33

How to control slick slider with links?

There is a list of links:

<ul>
    <li><a href="">One</a>
    <li><a href="">Two</a>
    <li><a href="">Three</a>
</ul>


And a slick slider with three slides, it is necessary that pagination be through these links: click on the second link - the 2nd slide appears, on the third - the third, and so on. Tried like this:
...
<li><a class="test"  href="">Two</a></li>

$('.test').click(function(e) {
    $('.js-event-slider').slick('next');
});


Here is the code, but here it is clumsily displayed https://jsfiddle.net/rinatoptimus/fL0rx6jn/1/

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey B., 2016-10-21
@rinatoptimus

codepen.io/anon/pen/bwOoqy
For this, there is asNavFor in the slick

I
iBird Rose, 2016-10-21
@iiiBird

Если всегда 3 и не меняются, используй slickGoTo

$('js-event-slider').slick('slickGoTo', 0);
$('js-event-slider').slick('slickGoTo', 1);
$('js-event-slider').slick('slickGoTo', 2);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question