PageSourceSearch

https://www.peoplenews.tw/wp-content/themes/soledad/js/ff40.js?ver=8.6.9

js peoplenews.tw collected 2026-09-24 09:25:47 UTC 6,511 bytes, 299 lines download raw bytes

1jQuery( document ).ready( function ( $ ) {
2
3	'use strict'
4	var PENCI = PENCI || {}
5
6	PENCI.owl_slider_40 = function () {
7
8		const swiper_thumb = new Swiper( '.nav-thumb-creative', {
9			rewind: true,
10			slidesPerView: 'auto',
11			slideActiveClass: 'active',
12			watchSlidesProgress: true,
13			on: {
14				init: function () {
15					$( '.nav-thumb-creative' ).addClass( 'penci-owl-loaded' )
16				},
17				afterInit: function () {
18					$( '.nav-thumb-creative' ).addClass( 'penci-featured-loaded' )
19				},
20			},
21			navigation: {
22				nextEl: '.next-button',
23				prevEl: '.prev-button',
24			},
25		} )
26
27		var slider = jQuery( '.slider-40-wrapper' ).first()
28		var mainwrap = slider.closest('.no-df-swiper')
29		var relitemlist = slider.find( '.list-slider-creative' ).first()
30		var currentslide = 0
31		var goToSlide = function ( newslide ) {
32			if ( slider.hasClass( 'loading' ) ) {
33				return
34			}
35			var oldslide = currentslide
36			currentslide = newslide
37			if ( currentslide >= slider.find( '.item-bg-slider-40' ).length ) {
38				currentslide = 0
39			} else if ( currentslide < 0 ) {
40				currentslide = slider.find( '.item-bg-slider-40' ).length - 1
41			}
42			if ( currentslide == oldslide ) {
43				return
44			}
45
46			var duration = 0.8
47			slider.addClass( 'loading' )
48			var currentbg = jQuery( slider.find( '.item-bg-slider-40' ) [currentslide] )
49			var oldbg = jQuery( slider.find( '.item-bg-slider-40' ) [oldslide] )
50			var currentbgcontent = jQuery(
51				slider.find( '.item-bg-slider-40-content' ) [currentslide] )
52			var oldbgcontent = jQuery(
53				slider.find( '.item-bg-slider-40-content' ) [oldslide] )
54			var currentitem = jQuery(
55				slider.find( '.item-slider-creative' ) [currentslide] )
56			var olditem = jQuery( slider.find( '.item-slider-creative' ) [oldslide] )
57			var currentitemcontent = currentitem.find( '.content-item-creative' )
58			var olditemcontent = olditem.find( '.content-item-creative' )
59			var currentitemimg = currentitem.find( '.img-container' )
60			var olditemimg = olditem.find( '.img-container' )
61			slider.find( '.content-item-creative' ).css( {
62				'width': relitemlist.width(),
63			} )
64			slider.find( '.item-bg-slider-40-content' ).css( {
65				'width': slider.width(),
66			} )
67			swiper_thumb.slideTo( currentslide )
68			slider.find( '.nav-thumb-creative .swiper-slide' ).removeClass( 'active' )
69			jQuery( slider.find( '.nav-thumb-creative .swiper-slide' ) [currentslide] ).addClass( 'active' )
70			slider.find( '.item-bg-slider-40, .item-slider-creative' ).css( {
71				'z-index': 5,
72			} )
73			currentbg.css( {
74				'z-index': 10,
75			} )
76			currentitem.css( {
77				'z-index': 10,
78			} )
79			oldbg.css( {
80				'z-index': 8,
81			} )
82			olditem.css( {
83				'z-index': 8,
84			} )
85			var resetCss = function () {
86				currentbg.css( {
87					'z-index': 12,
88				} )
89				currentitem.css( {
90					'z-index': 12,
91				} )
92				slider.find( '.item-bg-slider-40-content, .content-item-creative' ).css( {
93					'width': 'auto',
94					'left': 0,
95					'right': 0,
96				} )
97				slider.find( '.item-bg-slider-40, .item-slider-creative' ).css( {
98					'width': 'auto',
99					'left': 0,
100					'right': 0,
101				} )
102				slider.removeClass( 'loading' )
103			}
104			slider.find( '.item-bg-slider-40' )
105			if ( currentslide < oldslide ) {
106				currentbg.css( {
107					'width': '0',
108					'left': 'auto',
109					'right': 0,
110				} )
111				currentbgcontent.css( {
112					'right': 0,
113					'left': 'auto',
114				} )
115				currentitem.css( {
116					'width': '0',
117					'left': 0,
118					'right': 'auto',
119				} )
120				currentitemcontent.css( {
121					'right': 'auto',
122					'left': 0,
123				} )
124			} else {
125				currentbg.css( {
126					'width': '0',
127					'left': 0,
128					'right': 'auto',
129				} )
130				currentbgcontent.css( {
131					'right': 'auto',
132					'left': 0,
133				} )
134				currentitem.css( {
135					'width': '0',
136					'left': 'auto',
137					'right': 0,
138				} )
139				currentitemcontent.css( {
140					'right': 0,
141					'left': 'auto',
142				} )
143			}
144			TweenMax.fromTo(
145				currentbg,
146				duration,
147				{
148					width: 0,
149					force3D: true,
150					throwProps: false,
151					ease: Cubic.easeInOut,
152				},
153				{
154					width: slider.width(),
155				},
156			)
157			TweenMax.fromTo(
158				currentbgcontent,
159				duration,
160				{
161					scale: 1,
162					force3D: true,
163					throwProps: false,
164					ease: Cubic.easeInOut,
165				},
166				{
167					scale: 1.1,
168				},
169			)
170			TweenMax.to(
171				oldbgcontent,
172				duration,
173				{
174					scale: 1,
175					force3D: true,
176					throwProps: false,
177					ease: Cubic.easeInOut,
178				},
179			)
180			TweenMax.fromTo(
181				currentitem,
182				duration,
183				{
184					width: 0,
185					force3D: true,
186					throwProps: false,
187					ease: Cubic.easeInOut,
188				},
189				{
190					width: relitemlist.width(),
191					onComplete: function () {
192						resetCss()
193					},
194				},
195			)
196			TweenMax.fromTo(
197				currentitemimg,
198				duration,
199				{
200					scale: 1,
201					force3D: true,
202					throwProps: false,
203					ease: Cubic.easeIn,
204				},
205				{
206					scale: 1.1,
207				},
208			)
209			TweenMax.to(
210				olditemimg,
211				duration,
212				{
213					scale: 1,
214					force3D: true,
215					throwProps: false,
216					ease: Cubic.easeOut,
217				},
218			)
219		}
220		TweenMax.set(
221			jQuery( slider.find( '.img-container' ) [currentslide] ),
222			{
223				scale: 1.1,
224			},
225		)
226
227		
228
229		slider.find( '.nav-thumb-creative .swiper-slide' ).each(
230			function ( i ) {
231				var btn = jQuery( this )
232				
233				
234				btn.on( 'click', function () {
235					goToSlide( i )
236
237					$( '.nav-thumb-creative .swiper-slide' ).removeClass( 'active' )
238					btn.addClass( 'active' )
239					
240					return false
241				} )
242			},
243		)
244		slider.find( '.nav-slider-button' ).each(
245			function () {
246				var btn = jQuery( this ),
247					prevs,
248					nexts
249				btn.on(
250					'click',
251					function () {
252						var slideto
253						if ( btn.hasClass( 'prev-button' ) ) {
254							slideto = currentslide - 1
255							goToSlide( slideto )
256						} else {
257							slideto = currentslide + 1
258							goToSlide( slideto )
259						}
260					
261						return false
262					},
263				)
264			},
265		)
266
267		if ( mainwrap.attr('data-auto') === 'true' ) {
268			
269			var timeout = mainwrap.attr('data-autotime')
270
271			function slidetoslide() {
272				var slideto
273					slideto = currentslide + 1
274					goToSlide( slideto )
275
276			}
277
278			var intervalId = setInterval(slidetoslide, timeout);
279
280			// Pause interval on mouse enter
281			$('.featured-style-40').mouseenter(function() {
282				clearInterval(intervalId);
283			});
284
285			// Resume interval on mouse leave
286			$('.featured-style-40').mouseleave(function() {
287				intervalId = setInterval(slidetoslide, timeout);
288			});
289		}
290
291		
292	}
293
294	PENCI.owl_slider_40()
295
296	$( 'body' ).on( 'penci_swiper_sliders', function () {
297		PENCI.owl_slider_40()
298	} )
299} )

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.