import Swiper, { Navigation, Pagination} from 'swiper';
Swiper.use([Navigation, Pagination]);
const swiper1 = new Swiper('.swiper1', {
loop: true,
slidesPerView: 'auto',
spaceBetween: 40,
centeredSlides: true,
// autoHeight: true,
navigation: {
nextEl: '.button-next',
prevEl: '.button-prev',
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
const swiper2 = new Swiper('.swiper2', {
loop: true,
slidesPerView: 'auto',
spaceBetween: 40,
centeredSlides: true,
// autoHeight: true,
navigation: {
nextEl: '.button-next',
prevEl: '.button-prev',
},
pagination: {
el: ".swiper-pagination",
clickable: true,
},
});
import Swiper, { Navigation, Pagination} from 'swiper';
Swiper.use([Navigation, Pagination]);
const swiper1 = new Swiper('.swiper1', {
slidesPerView: 'auto',
loop: true,
centeredSlides: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: '.button-next',
prevEl: '.button-prev',
},
})
const swiper2 = new Swiper('.swiper2', {
slidesPerView: 'auto',
loop: true,
centeredSlides: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: '.button-next',
prevEl: '.button-prev',
},
})
import Swiper, { Navigation, Pagination} from 'swiper';
Swiper.use([Navigation, Pagination]);
document.querySelectorAll('.swiper').forEach(el => {
var swiper = new Swiper(el, {
slidesPerView: 'auto',
loop: true,
centeredSlides: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: '.button-next',
prevEl: '.button-prev',
},
});
});
одно дело странички подгружаются все сразу (т к расположены та все сразу в одном html) и совсем другое когда они подгружаются с надобностью