PageSourceSearch

https://www.mark.at/wp-content/plugins/nui-plugin/elementor-js/elementor-img-carousel.js

js mark.at collected 2026-10-08 08:27:25 UTC 4,043 bytes, 125 lines download raw bytes

1(function($) {
2    var contentCarousel = function ($scope, $) {
3		// =======================================================================================
4		// Content carousel
5		// Source: https://swiperjs.com/
6		// =======================================================================================
7
8		if ($(".tt-content-carousel").length) {
9		$(".tt-content-carousel").each(function() {
10			var $ttContentCarousel = $(this);
11
12			// Data attributes
13			// ================
14			var $dataSimulateTouch = $ttContentCarousel.data("simulate-touch");
15			var $autoplay = $ttContentCarousel.data("autoplay") ? { delay: $ttContentCarousel.data("autoplay"), } : $ttContentCarousel.data("autoplay");
16			var $dataLoop = $ttContentCarousel.data("loop") ? { loopedSlides: 100, } : $ttContentCarousel.data("loop");
17
18			if ($ttContentCarousel.is("[data-speed]")) {
19				var $dataSpeed = $ttContentCarousel.data("speed");
20			} else {
21				var $dataSpeed = 900; // by default
22			}
23
24			if ($ttContentCarousel.is("[data-pagination-type]")) {
25				var $dataPaginationType = $ttContentCarousel.data("pagination-type");
26			} else {
27				var $dataPaginationType = "bullets"; // by default (bullets/fraction/progressbar)
28			}
29
30			// Init Swiper
31			// =============
32			var $ttContentCarouselSwiper = new Swiper($ttContentCarousel.find(".swiper")[0], {
33				// Parameters
34				direction: "horizontal",
35				slidesPerView: "auto",
36				spaceBetween: 0,
37				centeredSlides: true,
38				longSwipesRatio: 0.3,
39				mousewheel: false,
40				keyboard: false,
41				preloadImages: false, // Needed for lazy loading
42				watchSlidesProgress: true, // Needed for lazy loading (if slidesPerView is "auto" or more than 1)
43				preventInteractionOnTransition: false, // No actions during transition
44				simulateTouch: $dataSimulateTouch,
45				grabCursor: $dataSimulateTouch,
46				speed: $dataSpeed,
47				autoplay: $autoplay,
48				loop: $dataLoop,
49				lazy: true,
50
51				// Navigation (arrows)
52				navigation: {
53					nextEl: $ttContentCarousel.find(".tt-cc-nav-next")[0],
54					prevEl: $ttContentCarousel.find(".tt-cc-nav-prev")[0],
55					disabledClass: "tt-cc-nav-arrow-disabled",
56				},
57
58				// Pagination
59				pagination: {
60					el: $ttContentCarousel.find(".tt-cc-pagination")[0],
61					type: $dataPaginationType,
62					modifierClass: "tt-cc-pagination-",
63					dynamicBullets: true,
64					dynamicMainBullets: 1,
65					clickable: true,
66				},
67
68				// Events
69				on: {
70					lazyImageReady: (swiper) => { // Lazy load + slidesPerView:"auto" fix.
71						$ttContentCarouselSwiper.update()
72					},
73
74					transitionStart: function () {
75
76						// Play video
77						$(".swiper-slide-active").find("video").each(function() {
78							$(this).get(0).play();
79						}); 
80
81					},
82
83					transitionEnd: function () {
84
85						// Pause video
86						$(".swiper-slide-prev").find("video").each(function() {
87							$(this).get(0).pause();
88						});
89						
90						$(".swiper-slide-next").find("video").each(function() {
91							$(this).get(0).pause();
92						});
93
94					}
95				}
96			});
97
98			// Scale down animation on carousel click
99			// =======================================
100			if ($ttContentCarousel.attr("data-simulate-touch") == "true") {
101				if ($ttContentCarousel.hasClass("cc-scale-down")) {
102					$ttContentCarousel.find(".swiper-wrapper").on("mousedown touchstart pointerdown", function(e) {
103						if (e.which === 1) { // Affects the left mouse button only!
104							gsap.to($ttContentCarousel.find(".tt-content-carousel-item"), { duration: 0.7, scale: 0.9 });
105						}
106					});
107					$("body").on("mouseup touchend pointerup mouseleave", function() {	
108						gsap.to($ttContentCarousel.find(".tt-content-carousel-item"), { duration: 0.7, scale: 1, clearProps: "scale" });
109					});
110				}
111			}
112
113		});
114
115	}
116
117
118    };
119
120    $(window).on('elementor/frontend/init', function () {
121        elementorFrontend.hooks.addAction('frontend/element_ready/nui-img-carousel.default', contentCarousel);
122    });
123
124   
125})(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.