init
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
define([
|
||||
'Swiper'
|
||||
], function (Swiper) {
|
||||
'use strict';
|
||||
|
||||
return function (config, element) {
|
||||
var hasNavigation = element.getAttribute('data-has-navigation') === 'true';
|
||||
var container = element.closest('.esun-news-room');
|
||||
|
||||
new Swiper(element, {
|
||||
slidesPerView: 1,
|
||||
slidesPerGroup: 1,
|
||||
spaceBetween: 36,
|
||||
observer: true,
|
||||
observeParents: true,
|
||||
watchOverflow: true,
|
||||
navigation: hasNavigation ? {
|
||||
nextEl: container.querySelector('.esun-news-room__next'),
|
||||
prevEl: container.querySelector('.esun-news-room__previous')
|
||||
} : {},
|
||||
pagination: hasNavigation ? {
|
||||
el: element.querySelector('.esun-news-room__pagination'),
|
||||
clickable: true
|
||||
} : {}
|
||||
});
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user