P
P
Pavel_202021-03-10 11:49:25
Layout
Pavel_20, 2021-03-10 11:49:25

How to make nav-slider not leave when scrolling the main slider?

There is a double slick-slider:
604887c14687a210186296.png

When I scroll through the main slider, the lower slides leave
604886215ae5b190048790.png

<div class="project-item__gallery">
                        <div class="project-item__slider">
                            <div class="project-item__slider-item"
                                style="background-image: url(img/projects/proj-1/main.jpg)"></div>
                            <div class="project-item__slider-item"
                                style="background-image: url(img/projects/proj-2/main.jpg)"></div>
                            <div class="project-item__slider-item"
                                style="background-image: url(img/projects/proj-3/main.jpg)"></div>
                            <div class="project-item__slider-item"
                                style="background-image: url(img/projects/proj-1/main.jpg)"></div>
                        </div>
                        <div class="project-item__nav-slider">
                            <div class="project-item__nav-slider-item"
                                style="background-image: url(img/projects/proj-1/nav/nav-1.jpg)"></div>
                            <div class="project-item__nav-slider-item"
                                style="background-image: url(img/projects/proj-1/nav/nav-2.jpg)"></div>
                            <div class="project-item__nav-slider-item"
                                style="background-image: url(img/projects/proj-1/nav/nav-3.jpg)"></div>
                            <div class="project-item__nav-slider-item"
                                style="background-image: url(img/projects/proj-1/nav/nav-4.jpg)"></div>
                        </div>
                    </div>
$('.project-item__slider').slick({
    slidesToScroll: 1,
    arrows: false,
    asNavFor: '.project-item__nav-slider',
    fade: true,
    //variableWidth: true,
    responsive: [
        {
            //breakpoint: ,
            settings: {
                
            }
        },
        {
            //breakpoint: ,
            settings: {
                
            }
        }
    ]
});

$('.project-item__nav-slider').slick({
    slidesToShow: 4,
    slidesToScroll: 1,
    arrows: false,
    asNavFor: '.project-item__slider',
    variableWidth: true,
    focusOnSelect: true,
    //centerMode: true,
    responsive: [
        {
            //breakpoint: ,
            settings: {
                
            }
        },
        {
            //breakpoint: ,
            settings: {
                
            }
        }
    ]
});


centerMode dubal will help, but no. Obviously something is wrong with slick-track, but it adds its own styles

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Chernenko, 2021-03-10
@Pavel_20

.project-item__nav-slider .slick-track{
    transform:none; /* возможно с !important */
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question