V
V
Vladislav2020-08-29 19:43:52
JavaScript
Vladislav, 2020-08-29 19:43:52

How to enable slick on a specific screen resolution?

the idea is that the slider on the computer is turned off, and on the tablet and phone it is initialized and
the slick code works

$('.filter__wrap-item').slick({
        slidesToShow: 2,
        slidesToScroll: 1,
        arrows: true,
        dots: true,
        infinite: false,
        responsive: [
            {
                breakpoint: 2500,
                settings: "unslick",
            },
            {
                breakpoint: 992,
                settings: "slick",
            },
        ]

    })

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-08-29
@apisklov

if( $(window).width() <= 768 ) {
$('.filter__wrap-item').slick({
        slidesToShow: 2,
        slidesToScroll: 1,
        arrows: true,
        dots: true,
        infinite: false,
        responsive: [
            {
                breakpoint: 2500,
                settings: "unslick",
            },
            {
                breakpoint: 992,
                settings: "slick",
            },
        ]

    })
}

or you can use the library

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question