(function($) { "use strict"; /** * @param $scope The Widget wrapper element as a jQuery element * @param $ The jQuery alias */ /** * Swiper activation * @param $scope * @param $ */ var WidgetSliderHandler = function($scope, $) { jQuery(".eicon-close").unbind('click'); if ($scope.find(".being-section").length > 0) { if (!$scope.find(".being-section").hasClass('scroll-init')) { ScrollTrigger.killAll(); if ($("body").hasClass("g-init")) { init_scroll(); } else { $("body").addClass("g-init"); setTimeout(() => { init_scroll(); }, 1000); } $("section.being-section").each(function() { let mq = gsap.matchMedia(); mq.add("(min-width: 920px)", () => { $(this).addClass("scroll-init"); }); mq.add("(max-width: 919px)", () => { $(this).removeClass("scroll-init"); }); }); } } }; // // Make sure you run this code under Elementor. $(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction('frontend/element_ready/widget', WidgetSliderHandler); }); }(jQuery));