Z
Z
z_u_q2018-09-26 09:25:30
JavaScript
z_u_q, 2018-09-26 09:25:30

Why doesn't slick slider work in tabs?

Good afternoon.
I make slick sliders in tabs.
In the first tab, everything is fine, it is displayed, scrolled through. And in the second, the slider disappears (although if you resize it appears, the slider in the first tab will fall apart).
How to fix this?

Reset two slides did.

$('.js-photo').slick("setPosition", 0);
$('.js-presentation').slick("setPosition", 0);


Example

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
Eugene Chefranov, 2018-09-26
@z_u_q

You need to reinitialize the slider after switching tabs

M
maralov, 2020-07-09
@maralov

this helped me
$('#slider').slick("refresh");

V
Vladislav Lyskov, 2018-09-26
@Vlatqa

use slickfilter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question