1{data.grid}
1{data.grid_lg}
0
1
5
15
30
{data.carousel_options.autoplay}false
{data.carousel_options.transitionSpeed}1000
truefalse
{direction}horizontal
{data.carousel_options.effect}fade
true
// Initialize Swiper when document is ready
document.addEventListener("DOMContentLoaded", function() {
var carouselElement = document.querySelector("#carousel-{data.uid} .gallery-wrapper");
var thumbsElement = document.querySelector(".swiper-thumbs-container");
if (carouselElement) {
// Initialize Swiper for Thumbnails
var swiperThumbs = new Swiper(thumbsElement, {
slidesPerView: 4,
spaceBetween: 10,
freeMode: true,
watchSlidesVisibility: true,
watchSlidesProgress: true,
});
// Initialize Main Swiper
var swiper = new Swiper('.swiper-container-{data.uid}', {
slidesPerView: {defaultGrid-{data.uid}},
spaceBetween: {gridGutters},
direction: '{direction}',
slidesPerGroup: 1,
loop: {loop},
autoHeight: false,
effect: '{effect}',
speed: {transitionSpeed},
grabCursor: true,
keyboard: {
enabled: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
pagination: {
el: '.swiper-pagination',
dynamicBullets: true,
},
thumbs: {
swiper: swiperThumbs,
},
breakpoints: {
992: {
slidesPerView: {defaultGridLg-{data.uid}},
spaceBetween: {gridGutters},
}
}
});
// Clone the thumbs container
if (thumbsElement) {
var clonedThumbs = thumbsElement.cloneNode(true);
clonedThumbs.classList.add("cloned-thumbs-container");
carouselElement.parentNode.insertBefore(clonedThumbs, carouselElement.nextSibling);
// Initialize Swiper for the cloned thumbs
new Swiper(clonedThumbs, {
slidesPerView: 4,
spaceBetween: 10,
freeMode: true,
watchSlidesVisibility: true,
watchSlidesProgress: true,
});
}
}
});