N
N
neverever2019-07-03 19:05:30
JavaScript
neverever, 2019-07-03 19:05:30

Why does the slider break?

00b028efe5.png

<div class="slider2">
                <div class="winner">
                    <div class="slide">
                        <div class="winners"></div>
                        <div class="block-winner">
                           
                        </div>
                        <div class="name-winner">
                            <div class="participants">
                               Жюри
                            </div>
                            <div class="name">
                                Вика Иванова
                            </div>
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="block-winner">
                       
                    </div>
                    <div class="name-winner">
                        <div class="participants">
                            Жюри
                        </div>
                        <div class="name">
                            Вика Иванова
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="block-winner">
                   
                    </div>
                    <div class="name-winner">
                        <div class="participants">
                             Жюри
                        </div>
                        <div class="name">
                            Вика Иванова
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="block-winner">
                 
                    </div>
                    <div class="name-winner">
                        <div class="participants">
                             Жюри
                        </div>
                        <div class="name">
                            Вика Иванова
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="block-winner">
                  
                    </div>
                    <div class="name-winner">
                        <div class="participants">
                             Жюри
                        </div>
                        <div class="name">
                            Вика Иванова
                        </div>
                    </div>
                </div>
                <div class="slide">
                    <div class="block-winner">
          
                    </div>
                    <div class="name-winner">
                        <div class="participants">
                             Жюри
                        </div>
                        <div class="name">
                            Вика Иванова
                        </div>
                    </div>
                </div>
            </div>

function slider2() {
    var slider2 = $('.slider2');

    if (slider2.length) {
        slider2.slick({
            infinite: true,
            slidesToShow: 3,
            slidesToScroll: 3,
            speed: 1000,
            arrows: true,
            responsive: [
                {
                    breakpoint: 780,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 2,
                        infinite: true,
                    }
                },
                {
                    breakpoint: 624,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1
                    }
                }
            ]
        });
    }
}

When scrolling through one slide, everything falls into place. But when you switch tabs - the slider is broken.
How to fix it? I can't think of any.
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question