S
S
saplas2019-04-19 17:34:58
JavaScript
saplas, 2019-04-19 17:34:58

What is the problem with slick slider?

I have a layout with

tabs when switching to other tabs, the slick slider does not work.

function mainTabs() {
    $('.main-tabs').on('click', 'li:not(.active)', function () {

        $(this)
            .addClass('active').siblings().removeClass('active')
            .closest('#discounts').find('.one-tab').removeClass('active').eq($(this).index()).addClass('active');
            

    });
    $('.main-tabs').on('click', 'li:not(.active)', function () {
       
        $(this)
            .addClass('active').siblings().removeClass('active')
            .closest('#discounts').find('.slider').slick('setPosition');

    });
}

on mob. not displayed at all.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Usachov, 2019-04-19
@rockfeeler

I think I need to reinit the slick when switching tabs. It's trying to refer to a block on the first slide that already has display: none.

L
LaraLover, 2019-04-19
@LaraLover

There was a problem with displaying slick in tabs, I solved it https://github.com/kenwheeler/slick/issues/187#iss...

N
NO, 2019-04-19
@Mihail9575

Judging, by mistake, you passed a non-existent parameter to it.
Can you describe in more detail when you were sent to work, what exactly did you do?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question