H
H
HamSter2016-06-18 18:38:36
JavaScript
HamSter, 2016-06-18 18:38:36

Why is slick slider not initialized in tab?

example

In the example, when you go to the next tab, the tab (second tab) should display a slick slider, but for some reason it doesn't work until you start clicking on the next\prev button.
As I understand it, this is due to the fact that the block in which the slider is placed initially has the display: none;.

How can this be fixed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
msatmb, 2016-07-15
@HamSter007

with tabs in bootstrap did this

$('[href="#tab4"]').on('shown.bs.tab', function (e) {
            $('.carousel').resize();
        });

V
Vitaly Inchin ☢, 2016-06-19
@In4in

You understand correctly.
After opening the tab:
$slider.slick("setPosition");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question