|
|
|
@ -12,6 +12,12 @@ function initCoreSwiper() { |
|
|
|
const root = document.querySelector(".sl2-core"); |
|
|
|
const el = root?.querySelector(".sl2-core__swiper"); |
|
|
|
if (!root || !el || !window.Swiper) return; |
|
|
|
|
|
|
|
const slideCount = el.querySelectorAll(".swiper-wrapper > .swiper-slide").length; |
|
|
|
if (slideCount <= 2) { |
|
|
|
root.classList.add("sl2-core--dual"); |
|
|
|
return; |
|
|
|
} |
|
|
|
new window.Swiper(el, { |
|
|
|
slidesPerView: 1, |
|
|
|
spaceBetween: 80, |
|
|
|
@ -25,6 +31,10 @@ function initCoreSwiper() { |
|
|
|
delay: 3e3, |
|
|
|
disableOnInteraction: false |
|
|
|
}, |
|
|
|
navigation: { |
|
|
|
prevEl: root.querySelector(".sl2-core__head .s-arrows__prev"), |
|
|
|
nextEl: root.querySelector(".sl2-core__head .s-arrows__next"), |
|
|
|
}, |
|
|
|
pagination: { |
|
|
|
el: root.querySelector(".sl2-core__pagination"), |
|
|
|
clickable: true |
|
|
|
@ -61,7 +71,7 @@ function initSceneSwiper() { |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
$(function() { |
|
|
|
$(function () { |
|
|
|
setActiveNav(); |
|
|
|
initCoreSwiper(); |
|
|
|
initSceneSwiper(); |
|
|
|
|