PageSourceSearch

https://www.florida-employment-lawyer.org/wp-content/themes/paperstreet/js/sliders.js?ver=1791503616

js florida-employment-lawyer.org collected 2026-10-09 00:31:38 UTC 6,999 bytes, 321 lines download raw bytes

1// Wrap all custom JS in an anonymous function that passes the alias "$" to everything so that "jQuery" doesn't have to be used
2(function ($) {
3	// Global variables
4	var autoplayDelay = 6000;
5
6	$(window).on("load", function () {
7		initializeSliders();
8	});
9
10	// Sets up all sliders present on the page
11	function initializeSliders() {
12		// Initialize each slider with the shared function
13		setupSwiper("#slider-results", {
14			loop: true,
15			autoplay: false,
16			effect: "fade",
17			fadeEffect: {
18				crossFade: true,
19			},
20			speed: 500,
21			autoHeight: true,
22			pagination: {
23				el: "#slider-results-pagination",
24				clickable: true,
25			},
26		});
27
28		setupSwiper("#slider-posts", {
29			loop: true,
30			autoplay: false,
31			effect: "fade",
32			fadeEffect: {
33				crossFade: true,
34			},
35			speed: 500,
36			navigation: {
37				prevEl: "#slider-posts-prev",
38				nextEl: "#slider-posts-next",
39			},
40		});
41
42		setupSwiper("#slider-attorneys-e", {
43			loop: true,
44			autoplay: false,
45			effect: "slide",
46			speed: 500,
47			slidesPerView: 1,
48			navigation: {
49				prevEl: "#slider-attorneys-e-prev",
50				nextEl: "#slider-attorneys-e-next",
51			},
52			breakpoints: {
53				768: {
54					slidesPerView: 2,
55					spaceBetween: 15,
56				},
57				1024: {
58					slidesPerView: 3,
59				},
60				1320: {
61					slidesPerView: 4,
62					spaceBetween: 20,
63				},
64			},
65		});
66
67		setupSwiper("#slider-testimonials-a", {
68			loop: true,
69			autoplay: {
70				delay: autoplayDelay,
71				disableOnInteraction: false,
72			},
73			effect: "fade",
74			fadeEffect: {
75				crossFade: true,
76			},
77			speed: 500,
78			pagination: {
79				el: "#slider-testimonials-a-pagination",
80				clickable: true,
81			},
82		});
83
84		setupSwiper("#slider-testimonials-b", {
85			loop: true,
86			autoplay: {
87				delay: autoplayDelay,
88				disableOnInteraction: false,
89			},
90			effect: "slide",
91			speed: 500,
92			navigation: {
93				prevEl: "#slider-testimonials-b-prev",
94				nextEl: "#slider-testimonials-b-next",
95			},
96		});
97
98		setupSwiper("#slider-practices-g", {
99			loop: true,
100			autoplay: {
101				delay: autoplayDelay,
102				disableOnInteraction: false,
103			},
104			effect: "slide",
105			speed: 500,
106			slidesPerView: 1,
107			slidesToScroll: 1,
108			navigation: {
109				prevEl: "#slider-practices-g-prev",
110				nextEl: "#slider-practices-g-next",
111			},
112			breakpoints: {
113				768: {
114					slidesPerView: 2,
115					spaceBetween: 35,
116				},
117			},
118		});
119
120		setupSwiper("#slider-blog-c", {
121			loop: true,
122			autoplay: {
123				delay: autoplayDelay,
124				disableOnInteraction: false,
125			},
126			effect: "slide",
127			speed: 300,
128			slidesPerView: 1,
129			navigation: {
130				prevEl: "#slider-blog-c-prev",
131				nextEl: "#slider-blog-c-next",
132			},
133			breakpoints: {
134				640: {
135					slidesPerView: 3,
136					spaceBetween: 40,
137				},
138			},
139		});
140
141		setupSwiper("#slider-blog-d", {
142			loop: true,
143			autoplay: {
144				delay: autoplayDelay,
145				disableOnInteraction: false,
146			},
147			effect: "fade",
148			fadeEffect: {
149				crossFade: true,
150			},
151			speed: 500,
152		});
153
154		setupSwiper("#slider-results-a", {
155			loop: true,
156			autoplay: {
157				delay: autoplayDelay,
158				disableOnInteraction: false,
159			},
160			effect: "slide",
161			speed: 300,
162			slidesPerView: 1,
163			navigation: {
164				prevEl: "#slider-results-a-prev",
165				nextEl: "#slider-results-a-next",
166			},
167			breakpoints: {
168				780: {
169					slidesPerView: 3,
170					spaceBetween: 20,
171				},
172			},
173		});
174
175		setupSwiper("#slider-results-b", {
176			loop: true,
177			autoplay: false,
178			effect: "slide",
179			speed: 300,
180			slidesPerView: 1,
181			navigation: {
182				prevEl: "#slider-results-b-prev",
183				nextEl: "#slider-results-b-next",
184			},
185			breakpoints: {
186				639: {
187					slidesPerView: 1,
188				},
189				768: {
190					slidesPerView: 2,
191				},
192				1024: {
193					slidesPerView: 3,
194				},
195				1200: {
196					slidesPerView: 4,
197				},
198			},
199		});
200
201		setupSwiper("#slider-badges-a", {
202			loop: true,
203			autoplay: false,
204			effect: "slide",
205			speed: 300,
206			slidesPerView: 1,
207			navigation: {
208				prevEl: "#slider-badges-a-prev",
209				nextEl: "#slider-badges-a-next",
210			},
211			breakpoints: {
212				640: {
213					slidesPerView: 3,
214				},
215				1024: {
216					slidesPerView: 4,
217					spaceBetween: 20,
218				},
219				1200: {
220					slidesPerView: 5,
221				},
222			},
223		});
224
225		// Child theme homepage sliders with arrow-based navigation
226		setupSwiper("#slider-home-arrows", {
227			loop: true,
228			autoplay: {
229				delay: autoplayDelay,
230				disableOnInteraction: false,
231			},
232			effect: "fade",
233			fadeEffect: {
234				crossFade: true,
235			},
236			speed: 500,
237			navigation: {
238				prevEl: "#slider-home-arrows-prev",
239				nextEl: "#slider-home-arrows-next",
240			},
241		});
242
243		// Child theme homepage sliders with dot-based pagination
244		setupSwiper("#slider-home-dots", {
245			loop: true,
246			autoplay: {
247				delay: autoplayDelay,
248				disableOnInteraction: false,
249			},
250			effect: "fade",
251			fadeEffect: {
252				crossFade: true,
253			},
254			speed: 500,
255			pagination: {
256				el: "#slider-home-dots .swiper-pagination",
257				clickable: true,
258			},
259		});
260
261		// Add pause/play buttons after initializing all sliders
262		addPauseButtons();
263	}
264
265	// Add pause/play control to all Swiper instances
266	function addPauseButtons() {
267		$(".swiper").each(function () {
268			// No button if the swiper has the class "no-pause"
269			if ($(this).hasClass("no-pause")) {
270				return;
271			}
272
273			const swiperID = $(this).attr("id");
274			// Check if swiperID exists before proceeding
275			if (!swiperID) {
276				return;
277			}
278
279			const swiperElement = `#${swiperID}`;
280			const swiperInstance = $(swiperElement)[0].swiper;
281
282			// Check if the Swiper instance is actively autoplaying
283			if (swiperInstance && swiperInstance.autoplay && swiperInstance.autoplay.running) {
284				const $toggleButton = $("<button>")
285					.addClass("swiper-autoplay-toggle no-button")
286					.attr("data-swiper-id", swiperID)
287					.html('<i class="fas fa-pause"></i><span class="visually-hidden">
287Pause</span>');
288
289				$(this).append($toggleButton);
290			}
291		});
292	}
293
294	// Event delegation for pause/play buttons
295	$("body").on("click", ".swiper-autoplay-toggle", function () {
296		const swiperID = $(this).attr("data-swiper-id");
297		// Check if swiperID exists before proceeding
298		if (!swiperID) {
299			return;
300		}
301
302		const swiperSelector = `#${swiperID}`;
303		const swiperElement = $(swiperSelector)[0];
304
305		// Check if element and swiper instance exist
306		if (!swiperElement || !swiperElement.swiper) {
307			console.warn(`Swiper instance not found for ID: ${swiperID}`);
308			return;
309		}
310
311		const swiper = swiperElement.swiper;
312
313		if (swiper.autoplay.running) {
314			swiper.autoplay.stop();
315			$(this).html('<i class="fas fa-play"></i><span class="visually-hidden">Play</span>');
316		} else {
317			swiper.autoplay.start();
318			$(this).html('<i class="fas fa-pause"></i><span class="visually-hidden">Pause</span>');
319		}
320	});
321})(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.