1(function($) { 2 var testiMonial = function ($scope, $) { 3 4 // ======================================================================================= 5 // Testimonials slider 6 // Source: https://swiperjs.com/ 7 // ======================================================================================= 8 9 if ($(".tt-testimonials-slider").length) { 10 $(".tt-testimonials-slider").each(function() { 11 var $ttTestimonialsSlider = $(this); 12 13 // Data attributes 14 // ================ 15 var $dataSimulateTouch = $ttTestimonialsSlider.data("simulate-touch"); 16 var $autoplay = $ttTestimonialsSlider.data("autoplay") ? { delay: $ttTestimonialsSlider.data("autoplay"), } : $ttTestimonialsSlider.data("autoplay"); 17 var $dataLoop = $ttTestimonialsSlider.data("loop") ? { loopedSlides: 100, } : $ttTestimonialsSlider.data("loop"); 18 19 if ($ttTestimonialsSlider.is("[data-speed]")) { 20 var $dataSpeed = $ttTestimonialsSlider.data("speed"); 21 } else { 22 var $dataSpeed = 900; // by default 23 } 24 25 // Init Swiper 26 // ============= 27 var $ttTestimonialsSliderSwiper = new Swiper ($ttTestimonialsSlider.find(".swiper")[0], { 28 // Parameters 29 direction: "horizontal", 30 slidesPerView: "auto", 31 spaceBetween: 0, 32 mousewheel: false, 33 longSwipesRatio: 0.3, 34 grabCursor: true, 35 autoHeight: true, 36 centeredSlides: true, 37 preventInteractionOnTransition: false, // No actions during transition 38 speed: $dataSpeed, 39 simulateTouch: $dataSimulateTouch, 40 autoplay: $autoplay, 41 loop: $dataLoop, 42 43 // Navigation (arrows) 44 navigation: { 45 nextEl: $ttTestimonialsSlider.find(".tt-ts-nav-next")[0], 46 prevEl: $ttTestimonialsSlider.find(".tt-ts-nav-prev")[0], 47 disabledClass: "tt-ts-nav-arrow-disabled", 48 }, 49 50 // Pagination 51 pagination: { 52 el: $ttTestimonialsSlider.find(".tt-ts-pagination")[0], 53 type: "bullets", 54 modifierClass: "tt-ts-pagination-", 55 dynamicBullets: true, 56 dynamicMainBullets: 1, 57 clickable: true, 58 } 59 }); 60 61 // Auto height fix 62 setTimeout(function() { 63 $ttTestimonialsSliderSwiper.updateAutoHeight(); 64 }, 100); 65 66 // Scale down animation on slider click 67 if ($ttTestimonialsSlider.hasClass("ts-scale-down")) { 68 $ttTestimonialsSlider.find(".swiper-wrapper").on("mousedown touchstart pointerdown", function(e) { 69 if (e.which === 1) { // Affects the left mouse button only! 70 gsap.to($ttTestimonialsSlider.find(".tt-ts-item-inner"), { duration: 0.7, scale: 0.9 }); 71 } 72 }); 73 $("body").on("mouseup touchend pointerup", function() { 74 gsap.to($ttTestimonialsSlider.find(".tt-ts-item-inner"), { duration: 0.7, scale: 1, clearProps: "scale" }); 75 }); 76 } 77 }); 78 } 79 80 81 }; 82 83 $(window).on('elementor/frontend/init', function () { 84 elementorFrontend.hooks.addAction('frontend/element_ready/nui-testimonial.default', testiMonial); 85 }); 86 87 88})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.