Answer the question
In order to leave comments, you need to log in
How to combine slick slider and magnific popup correctly?
Using slick slider + magnific popup: example .
It is necessary that when you click on a certain button, the desired slide opens, for example, when you click on button 2, slide 2 opens in a row, when you click on 3, slide 3 opens, etc.
When you press the first time, everything works, but the second and subsequent times it does not work.
Answer the question
In order to leave comments, you need to log in
$('.popup-link').magnificPopup({
midClick: true,
type: 'inline',
callbacks: {
open() {
const $slider = $('.slider');
if (!$slider.hasClass('slick-initialized')) {
$slider.slick({
infinite: true,
slidesToShow: 1,
dots: true,
});
}
$slider.slick('slickGoTo', +$(this).attr('index'));
},
},
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question