Answer the question
In order to leave comments, you need to log in
Why does a bug appear in the slider when adding responsive?
Hello. Please tell me why a bug appears in the slider when adding responsive? If you remove the adaptation in the slider, then everything works.
You can see it here , the slider is placed at the top of the page in the accordion.
I am attaching the code:
$('.works-slider').slick({
slidesToShow: 2,
slidesToScroll: 2,
fade: false,
arrows: true,
dots: false,
swipe: true,
responsive: [
{
breakpoint: 576,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
}
}
]
});
$('.collapse__content').on('shown.bs.collapse', function () {
$('.works-slider').slick('reinit');
});
Answer the question
In order to leave comments, you need to log in
I found the reason. When opening and closing the accordion, the slider code is duplicated. It remains to figure out how to fix it.
Try this:
if (window.innerWidth <= 576) {
$('.works-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question