PageSourceSearch

https://www.toyota-lf.com/js/content/products.js

js toyota-lf.com collected 2026-10-02 06:28:55 UTC 8,646 bytes, 319 lines download raw bytes

1/**
2 * ================================================
3 *
4 * [products]
5 *
6 * ================================================
7 */
8var rTimer 		= false,
9	isFirst 	= true;
10	
11var	tabsH		= 0,
12	tabID		= '';
13
14var slider01 	= false,
15	totalSlide 	= 0,
16  isAllowSlide = false;
17/**
18 ********************************************
19 * load event
20 ********************************************
21 */
22(function($) {
23	$(function() {
24		functions.init();
25		/**
26		 ********************************************
27		 * resize event
28		 ********************************************
29		 */
30		$(window).resize(function() {
31			if (rTimer !== false) {
32				clearTimeout(rTimer);
33			}
34
35			rTimer = setTimeout(function() {
36				functions.adjust();
37
38				if ($.params.isChangeMode) {
39					prdIndex.reset();
40				} else {
41					if ($.params.isChangeWHeight) {
42						prdIndex.reset();
43					}
44				}
45			}, 1000);
46		});
47		/**
48		 ********************************************
49		 * click event
50		 ********************************************
51		 */
52		$('.popupBtItem.movie').on('click', function() {
53			var video = $(this).attr('data-video'),
54			id = $(this).attr('data-popup');
55			$('#' + id + ' .content').html('<iframe src="//www.youtube.com/embed/' + video + '?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>');
56		});
57	});
58}(jQuery));
59/**
60 **********************************************************
61 *
62 * functions
63 *
64 **********************************************************
65 */
66var functions = {
67	init: function() {
68		setTimeout(function() {
69			if ($('body').hasClass('detail')) {
70				setTimeout(function() {
71					functions.initMainSlider();
72				}, 500);
73			}
74			functions.adjust();
75		}, 500);
76	},
77	adjust: function() {
78		if (!$.params.isRespMode) {
79			//インデックス
80			if ($('body').hasClass('index')) {
81				// $('.tabs ul li a').adjustSize();
82				$('.tabs .select').each(function() {
83					tabID = $(this).attr('id');
84					tabsH = $(this).next('.lNav').outerHeight();
85					$('.tabContents.' + tabID).css({
86						paddingTop: tabsH
87					});
88				});
89
90				if (!prdIndex.params.isSet) prdIndex.init();
91			}
92
93			//商品一覧
94			if ($('body').hasClass('list')) {
95				$('.sectionVox').each(function() {
96					$(this).find('.productList a').adjustSize();
97				});
98				tabsH = $('.lNav.work').outerHeight() + 30;
99				$('#productsWrapper').css({
100					paddingTop: tabsH
101				});
102			}
103
104			//商品詳細
105			if ($('body').hasClass('detail')) {
106				$('.sectionVox').each(function() {
107					$(this).find('.voxStyle01').adjustSize();
108				});
109			}
110
111		} else {
112			//インデックス
113			if ($('body').hasClass('index')) {
114				$('.tabContents').css({
115					paddingTop: 0
116				});
117			}
118
119			//商品一覧
120			if ($('body').hasClass('list')) {
121				$('.productList a').height('auto');
122				$('#productsWrapper').css({
123					paddingTop: 0
124				});
125			}
126
127			//商品詳細
128			if ($('body').hasClass('detail')) {
129				$('.voxStyle01').height('auto');
130			}
131		}
132
133		//インデックス
134		if ($('body').hasClass('index')) {
135			if ($.params.isChangeWWidth) {
136				$('.categoryList a').adjustSize({
137					plus: 20
138				});
139			}
140		}
141
142		if (isFirst) functions.runIntro();
143	},
144	//スライダー
145	initMainSlider: function() {
146		totalSlide = $('.intro .slider ul li').length;
147
148		if (slider01 || totalSlide <= 1) {
149      functions.adjust();
150      $('.intro .slider ul').css('visibility', 'visible');
151      return;
152    };
153
154		slider01 = $('.intro .slider ul').bxSlider({
155			// mode: 'horizontal',
156			useCSS: false,
157			easing: 'easeOutExpo',
158			// pager: true,
159			// pagerCustom: $.params.isRespMode ? null : '#sliderThm',
160			// controls: true,
161			// prevSelector: '#sliderPrev',
162			// nextSelector: '#sliderNext',
163      pager: false,
164      controls: false,
165			speed: 800,
166			pause: 5000,
167			auto: false,
168			startSlide: 0,
169			infiniteLoop: true,
170			moveSlides: 1,
171			minSlides: 1,
172			// maxSlides: 1,
173      touchEnabled: $.params.isRespMode ? true : false,
174      onSlideBefore: function(a, b, c) {
175  			isAllowSlide = false;
176        $('#sliderThm li a').removeClass('active').closest('.inner').find(' li').eq(slider01.getCurrentSlide()).find('a').addClass('active');
177        $('.sliderPager .bx-pager-item a').removeClass('active').closest('.sliderPager').find(' .bx-pager-item').eq(slider01.getCurrentSlide()).find('a').addClass('active');
178			},
179			onSlideAfter: function(a, b, c) {
180				isAllowSlide = true;
181			},
182			onSliderLoad: function() {
183        setTimeout(function() {
184					if (!$.params.isRespMode) {
185            $('#sliderThm li').eq(0).find('a').addClass('active');
186            $(document).on('click.pager', '#sliderThm li a', function() {
187              if (!isAllowSlide || $(this).hasClass('active')) return;
188              slider01.goToSlide($(this).data('slide-index'));
189              return false;
190            });
191            $('<div class="sliderCtrls"><span id="sliderPrev" class="trOp01"><a class="bx-prev" href="javascript:void(0)">Prev</a></span><span id="sliderNext" class="trOp01"><a class="bx-next" href="javascript:void(0)">Next</a></span></div>').appendTo('.intro .slider');
192            $(document).on('click.pager', '.sliderCtrls .bx-prev', function() {
193							if (!isAllowSlide) return;
194							slider01.goToPrevSlide();
195              return false;
196						});
197						$(document).on('click.pager', '.sliderCtrls .bx-next', function() {
198							if (!isAllowSlide) return;
199							slider01.goToNextSlide();
200              return false;
201						});
202            isAllowSlide = true;
203					} else {
204            if (totalSlide > 1) {
205              $('<div class="bx-controls bx-has-pager sliderPager"><div class="bx-pager bx-default-pager" /></div>').appendTo('.intro .slider .bx-wrapper');
206              for (let i = 0; i < totalSlide; i++) {
207								$('<div class="bx-pager-item"><a href="javascript:void(0)" data-slide-index="' + i + '" class="bx-pager-link"><!-- --></a></div>').appendTo('.sliderPager .bx-pager');
208							}
209              $('.sliderPager .bx-pager-item').eq(0).find('a').addClass('active');
210              $(document).on('click.pager', '.sliderPager .bx-pager-item a', function() {
211								if (!isAllowSlide || $(this).hasClass('active')) return;
212								slider01.goToSlide($(this).data('slide-index'));
213							});
214							isAllowSlide = true;
215            }
216          }
217					functions.adjust();
218					$('.intro .slider ul').css('visibility', 'visible');
219				}, 100);
220			}
221		});
222	},
223	resetMainSlider: function() {
224		slider01.stopAuto();
225		slider01.destroySlider();
226		slider01 = false;
227		$('.intro .slider ul').css('visibility', 'hidden');
228	},
229	runIntro: function() {
230		isFirst = false;
231
232		if (isSkip) {
233			time = 500;
234
235			setTimeout(function() {
236				$('#loading').velocity({
237					opacity: 0
238				}, {
239					duration: 300,
240					display: 'none'
241				});
242
243				if (location.hash !== '') {
244					$(location.hash).velocity('stop').velocity('scroll', {
245						offset: -(hHeight + 50),
246						duration: 10,
247						easing: 'easeInQuad'
248					});
249				}
250
251				if ($.params.qsParm.length === 0 && !location.hash) {
252					$('#wrapper').velocity('scroll', 10);
253				}
254
255				$('#wrapper').css({
256					visibility: 'visible'
257				}).velocity({
258					opacity: 1
259				}, 500, function() {
260					//
261
262				});
263			}, time);
264		}
265	}
266};
267
268var prdIndex = {
269	params: {
270		pos: new Array,
271		isShow: false,
272		length: 0
273	},
274	init: function() {
275		prdIndex.params.length = $('.sectionVox').length;
276		prdIndex.setPos();
277		$('#activeCategory').hide();
278
279		$(window).on('scroll.checkPos', function() {
280			prdIndex.checkPos();
281		});
282	},
283	setPos: function() {
284		$('.tabContents:visible .sectionVox').each(function(i) {
285			var id = $(this).attr('id');
286			prdIndex.params.pos[i] = $(this).offset().top + ($.params.wHeight / 2.5);
287		});
288		prdIndex.params.isSet = true;
289	},
290	checkPos: function() {
291		if ($.params.scrTop === 0) {
292			$('#activeCategory').hide();
293			isShow = false;
294			return;
295		}
296		var name = '';
297		$.each(prdIndex.params.pos, function(i, val) {
298			if ($.params.scrTop + $.params.wHeight > val) {
299				name = $('.tabContents:visible .sectionVox').eq(i).find('h2').text();
300			} else {
301				return false;
302			}
303		});
304		if (name) {
305			$('#activeCategory').show().text(name);
306			isShow = true;
307		}
308	},
309	destroy: function() {
310		prdIndex.params.pos = new Array;
311		prdIndex.params.length = 0;
312		prdIndex.params.isShow = false;
313		$(window).off('checkPos');
314	},
315	reset: function() {
316		prdIndex.destroy();
317		prdIndex.init();
318	}
319};

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.