1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| if (stellar.plugins.swiper) { const swiper_container = document.getElementById('swiper_container'); if (swiper_container !== undefined && swiper_container !== null) { stellar.loadCSS(stellar.plugins.customSwiperTopArticle.css); stellar.loadScript(stellar.plugins.customSwiperTopArticle.js, {defer:true}).then(function () { var swiper = new Swiper('.blog-slider', { passiveListeners: true, spaceBetween: 30, effect: 'fade', loop: true, autoplay: { disableOnInteraction: true, delay: 5000 }, mousewheel: true, pagination: { el: '.blog-slider__pagination', clickable: true, } }); swiper_container.onmouseenter = function() { swiper.autoplay.stop(); }; swiper_container.onmouseleave = function() { swiper.autoplay.start(); } }); }
const swiper_api = document.getElementById('swiper-api'); if (swiper_api != undefined) { stellar.loadCSS(stellar.plugins.swiper.css); stellar.loadScript(stellar.plugins.swiper.js, { defer: true }).then(function () { const effect = swiper_api.getAttribute('effect') || ''; var swiper = new Swiper('.swiper#swiper-api', { slidesPerView: 'auto', spaceBetween: 8, centeredSlides: true, effect: effect, loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, }); }) } }
|