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