| 1 |
(function ($, elementor) { |
| 2 |
("use strict"); |
| 3 |
var ClassicCarousel = function ($scope, $) { |
| 4 |
var $gridCarousel = $scope.find(".usk-edd-classic-carousel"); |
| 5 |
if (!$gridCarousel.length) { |
| 6 |
return; |
| 7 |
} |
| 8 |
var $gridCarouselContainer = $gridCarousel.find(".swiper-carousel"); |
| 9 |
var $settings = $gridCarousel.find(".usk-carousel").data("settings"); |
| 10 |
|
| 11 |
const Swiper = elementorFrontend.utils.swiper; |
| 12 |
initSwiper(); |
| 13 |
async function initSwiper() { |
| 14 |
var swiper = await new Swiper($gridCarouselContainer, $settings); // this is an example |
| 15 |
if ($settings.pauseOnHover) { |
| 16 |
$($gridCarouselContainer).hover(function () { |
| 17 |
(this).swiper.autoplay.stop(); |
| 18 |
}, function () { |
| 19 |
(this).swiper.autoplay.start(); |
| 20 |
}); |
| 21 |
} |
| 22 |
}; |
| 23 |
}; |
| 24 |
jQuery(window).on("elementor/frontend/init", function () { |
| 25 |
elementorFrontend.hooks.addAction( |
| 26 |
"frontend/element_ready/usk-edd-classic-carousel.default", |
| 27 |
ClassicCarousel |
| 28 |
); |
| 29 |
}); |
| 30 |
})(jQuery, window.elementorFrontend); |
| 31 |
|