init
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
define([
|
||||
'Swiper'
|
||||
], function (Swiper) {
|
||||
'use strict';
|
||||
|
||||
return function (config, element) {
|
||||
var hasNavigation = element.getAttribute('data-has-navigation') === 'true';
|
||||
|
||||
if (window.matchMedia('(max-width: 639px)').matches) {
|
||||
return;
|
||||
}
|
||||
|
||||
new Swiper(element, {
|
||||
slidesPerView: 1.26,
|
||||
spaceBetween: 12,
|
||||
observer: true,
|
||||
observeParents: true,
|
||||
watchOverflow: true,
|
||||
breakpoints: {
|
||||
768: {
|
||||
slidesPerView: 2,
|
||||
spaceBetween: 20
|
||||
},
|
||||
1024: {
|
||||
slidesPerView: 4,
|
||||
spaceBetween: 28
|
||||
}
|
||||
},
|
||||
navigation: hasNavigation ? {
|
||||
nextEl: element.querySelector('.esun-create-anything__next'),
|
||||
prevEl: element.querySelector('.esun-create-anything__previous')
|
||||
} : {},
|
||||
pagination: hasNavigation ? {
|
||||
el: element.querySelector('.esun-create-anything__pagination'),
|
||||
clickable: true
|
||||
} : {}
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user