D
D
Darren_Clyde2016-11-14 12:47:26
JavaScript
Darren_Clyde, 2016-11-14 12:47:26

How to make a preview in slick slider?

It is not possible to make a slider with navigation in the form of a preview for these slides. I use Slick.
Here is the HTML:

<div class="slider-for">
      <div><img src="img/photo-example.png" alt=""></div>
      <div><img src="img/photo-example.png" alt=""></div>
      <div><img src="img/photo-example.png" alt=""></div>
</div>
<div class="slider-nav">
      <div>1</div>
      <div>2</div>
      <div>3</div>
</div>

Here is js:
$('.slider-for').slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        fade: true,
        asNavFor: '.slider-nav'
    });
    
    $('.slider-nav').slick({
        slidesToShow: 3,
        slidesToScroll: 1,
        asNavFor: '.slider-for'
    });

The slider itself scrolls, but the navigation does not work. There are no errors in the console.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey B., 2016-11-14
@Darren_Clyde

Add focusOnSelect: truefor.slider-nav

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question