Answer the question
In order to leave comments, you need to log in
How to reinitialize Swiper inside Magnific Popup?
There is a gallery of modal windows Magnific Popup. You can open them all separately, or you can open one and flip inside.
$('.open-example').magnificPopup({
mainClass: 'mfp-fade',
type: 'inline',
gallery:{
enabled: true,
arrows: false
},
callbacks: {
beforeOpen: function(){
$(window).trigger('resize');
}
}
});
$('.prev-proj').on('click', function(e) {
e.preventDefault();
$.magnificPopup.instance.prev();
return false;
});
$('.next-proj').on('click', function(e) {
e.preventDefault();
$.magnificPopup.instance.next();
return false;
});
var galleryTop = new Swiper('.gallery-top', {
loop:true,
loopedSlides: 6,
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
var galleryThumbs = new Swiper('.gallery-thumbs', {
spaceBetween: 20,
loop:true,
loopedSlides: 6,
slidesPerView: 3,
touchRatio: 0.2,
slideToClickedSlide: true,
});
galleryTop[0].controller.control = galleryThumbs;
galleryThumbs[1].controller.control = galleryTop;
galleryTop[0].controller.control = galleryThumbs;
galleryThumbs[1].controller.control = galleryTop;
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