Здравствуйте, есть данные настройки по swiper-master, и я сделал что бы при маленьких разрешениях было другое кол-во слайдов, подскажите как можно сократить код:
if( window.innerWidth >= 992 ){
var swiper4 = new Swiper('.swiper-4', {
slidesPerView: 6,
spaceBetween: 30,
loop: true,
pagination: {
el: '.swiper-pagination4',
clickable: true,
},
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
} else if ( window.innerWidth <= 480 ) {
var swiper4 = new Swiper('.swiper-4', {
slidesPerView: 1,
spaceBetween: 30,
loop: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination4',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
} else {
var swiper4 = new Swiper('.swiper-4', {
slidesPerView: 3,
spaceBetween: 30,
loop: true,
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination4',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
});
}