Answer the question
In order to leave comments, you need to log in
Slick slider - why is the second one not displayed?
when I try to display 2 sliders, the first one starts, the second one doesn’t,
I’m not strong in js , I
copy the initialization code, I substitute the desired container class
, maybe something else needs to be changed here? i.e. I suspect that something is duplicated
const init = {
autoplay: true,
infinite: true,
cssEase: "linear",
slidesToShow: 2,
slidesToScroll: 1,
dots:true
};
$(() => {
const win = $(window);
const slider = $(".slider-one");
win.on("load resize", () => {
if (win.width() < 420) {
slider.not(".slick-initialized").slick(init);
} else if (slider.hasClass("slick-initialized")) {
slider.slick("unslick");
}
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question