PageSourceSearch

https://toyotanso.com/Scripts/script.js?ver=1660700568

js toyotanso.com collected 2026-10-01 05:37:57 UTC 8,242 bytes, 319 lines download raw bytes

1$(function(){
2	/*TOP・下層共通*/
3	/************************************************/
4	var w = $(window).width();
5	var timer = false;
6
7  var _ua = (function(){
8    return {
9      ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined",
10      ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined",
11      ltIE9:document.uniqueID && typeof window.matchMedia == "undefined",
12      gtIE10:document.uniqueID && window.matchMedia,
13      Trident:document.uniqueID,
14      Gecko:'MozAppearance' in document.documentElement.style,
15      Presto:window.opera,
16      Blink:window.chrome,
17      Webkit:typeof window.chrome == "undefined" && 'WebkitAppearance' in document.documentElement.style,
18      Touch:typeof document.ontouchstart != "undefined",
19      Mobile:typeof window.orientation != "undefined",
20      ltAd4_4:typeof window.orientation != "undefined" && typeof(EventSource) == "undefined",
21      Pointer:window.navigator.pointerEnabled,
22      MSPoniter:window.navigator.msPointerEnabled
23    }
24  })();
25
26	/*関数呼び出し*/
27	//$('#header .h-menu .gn').on('click',gn_accordion);
28	more_btn_func01(w);
29
30	/*ウィンドウリサイズ時処理*/
31	$(window).resize(function() {
32		w = $(window).width();
33		if (timer !== false) {
34			clearTimeout(timer);
35		}
36		timer = setTimeout(function() {
37			/*TOP用*/
38			if($('#totop').length!==0){				
39				more_btn_func01(w);
40				slider01();
41				if(w>640){
42					if($('.menu_trigger a').hasClass('active')){
43						var $btnObj = $('.menu_trigger a');
44						$btnObj.removeClass();
45						$('#coverLayer').remove();
46						$('#gnav ul').css('display','')
47					}
48					if(!_ua.ltIE8){
49						home_update_tab_func();
50					}
51					if(!_ua.ltIE7){
52						equalHeight('#container','.hf_making_philosophy .piclist_wrap .txt_wrap',4);
53						equalHeight('#container','.hf_products .piclist_wrap .txt_wrap',4);
54					}
55				}
56				else {
57					home_update_tab_func02();
58					if(!_ua.ltIE7){
59						$('#container .hf_products .piclist_wrap .txt_wrap').height('auto');
60						equalHeight('#container','.hf_making_philosophy .piclist_wrap .txt_wrap',2);
61					}
62				}
63			}
64
65		}, 200);
66	});
67
68	/*IE7用*/
69	if(_ua.ltIE7){
70		$('html').addClass('ie7');
71  }
72	/*IE8用*/
73	if(_ua.ltIE8){
74		$('html').addClass('ie8');
75  }
76	
77	/*TOP用*/
78	/************************************************/
79	if($('#totop').length!==0){
80		
81		smoothScroll();
82		$('#gnav ul').addClass('state_close');
83		gNavFunc();
84		if(w>640){
85			home_update_tab_func();
86			if(!_ua.ltIE7){
87				equalHeight('#container','.hf_making_philosophy .piclist_wrap .txt_wrap',4);
88				equalHeight('#container','.hf_products .piclist_wrap .txt_wrap',4);
89			}
90		}
91		else {
92			home_update_tab_func02();
93			if(!_ua.ltIE7){
94				equalHeight('#container','.hf_making_philosophy .piclist_wrap .txt_wrap',2);
95			}
96		}
97
98
99    if ($("#main_image").length > 0) {
100      $container = $("#main_image");
101      $container.imagesLoaded(function () {
102        $("#main_image").css("visibility", "visible");
103        slider01();
104      });
105    }
106		$('#gnav li:first-child').addClass('first_c');
107	}
108
109	/*下層用*/
110	/************************************************/
111	else{
112	}
113});
114
115/* TOPスライダー */
116var slider01 = function(){
117	$('#main_image > ul').carouFredSel({
118		auto: true,
119		responsive: true,
120		height: 'variable',
121		items:{
122			visible: 1,
123			height: 'variable'
124		},
125		auto : 5000,
126		scroll:{
127			duration : 1500
128		},
129		pagination: {
130			container: '.pager',
131			anchorBuilder: function(){
132				return '<a href="#">'+ ' ' +'</a>';
133			}
134		},
135		swipe: {
136			onTouch: true
137		}
138	});
139}
140
141/* ヘッダアコーディオン */
142var gn_accordion = function(){
143	var $shoObj = $('#header .h_global_network');
144	if(!$shoObj.hasClass('state_open')){
145		$shoObj.addClass('state_open').slideDown(400);
146	}
147	else{
148		$shoObj.removeClass('state_open').slideUp(400);
149	}
150}
151
152/* スムーススクロール */
153var smoothScroll = function(){
154	var options = {
155		selector: '[href^=#]',
156		duration: 400,
157		easing: 'linear',
158		notClass: '.not_smoooth'
159	};
160	
161	var
162	$selector = $(options.selector).not('[href=#]').not(options.notClass),
163	$target = $('html, body');
164	
165	$selector.on('click', function(){
166		var data = $(this).data('smooth') || 0;
167			$target.animate({
168				scrollTop: $(this.hash).offset().top + data
169			},{
170			duration: options.duration,
171			easing: options.easing
172		});
173		return false;
174	});	
175}
176
177/* スマホ版グローバルナビ */
178var gNavFunc = function(){
179	$('.menu_trigger a').on('click', function() {
180		if(!$(this).hasClass('active')){
181			$(this).removeClass('def');
182			$(this).addClass('active');
183			
184			$('#gnav ul').slideDown(400);
185			$('body').append('<div id="coverLayer"></div>');			
186
187			$('#coverLayer').on('click', function() {
188				var $btnObj = $('.menu_trigger a');
189				$btnObj.addClass('def');
190				$btnObj.removeClass('active');
191				$('#gnav ul').slideUp(400);
192				$('#coverLayer').remove();
193			});
194		}
195		else {
196			$(this).addClass('def');
197			$(this).removeClass('active');
198			$('#gnav ul').slideUp(400);
199			$('#coverLayer').remove();
200		}
201		return false;
202	});
203}
204
205/* TOP更新情報タブ */
206var home_update_tab_func = function() {
207	if($('#container .update_tab01').size()!==0){
208		var $wrapObj = $('#container');
209		var $articleObj = $('.update_list01',$wrapObj);
210		var $tabBtnObj = $('.update_tab01 li',$wrapObj);
211
212		$articleObj.eq(0).addClass('show');
213		$tabBtnObj.eq(0).addClass('current');
214
215		$tabBtnObj.on('click', function(){
216		 var num = $('.update_tab01 li',$wrapObj).index(this);
217		 var $showObj = $articleObj.eq(num);
218
219			if(!$showObj.hasClass('show')){
220				$articleObj.each(function(){
221					$(this).removeClass('show');								
222				});
223				$tabBtnObj.each(function(){
224					if($(this).hasClass('current')){
225						$(this).removeClass('current');
226					}
227				});
228				$showObj.addClass('show');
229				$(this).addClass('current');
230			}
231		});	
232	}
233}
234
235/* TOP更新情報タブ(スマホ) */
236var home_update_tab_func02 = function() {
237	if($('#container .update_tab01').size()!==0){
238		var $wrapObj = $('#container');
239		var $articleObj = $('.update_list01',$wrapObj);
240		var $tabBtnObj = $('.update_tab01 li',$wrapObj);
241		$articleObj.removeClass('show');
242		$($tabBtnObj).removeClass('current');
243	}
244}
245
246/* 要素の高さそろえる */
247var equalHeight = function(obj,flatobj,num){
248	var sets = [], temp = [];
249	$(obj).find(flatobj).each(function(i) {
250		$(this).height();
251		temp.push(this);
252		if ((i+1) % num == 0) {
253			sets.push(temp);
254			temp = [];
255		}
256	});
257	if (temp.length) sets.push(temp);
258	$.each(sets, function() {
259		$(this).flatHeights();
260	});
261	sets = [], temp = [];
262};
263
264/* ニュースリリースボタン */
265var more_btn_func01 = function(w){
266	var $wrapObj = $('#container');
267	var $btnObj = $('.update_list_container .more_btn a',$wrapObj);
268	if(w>640){
269		$btnObj.text('Read more');
270	}
271	else {
272		$btnObj.text('News Release List');
273	}
274};
275
276
277/* ヘッダーサブメニュー */
278function switchByWidth() {
279  if (window.matchMedia("(max-width: 767px)").matches) {
280    //スマホ処理
281    $(document).ready(function () {
282			console.log("test2");
283    $("#gnav .parent").unbind("mouseenter mouseleave");
284
285    $(".sp-submenu-btn").click(function () {
286      $(this).toggleClass("is-on");
287			$(this).next(".submenu:not(:animated)").slideToggle();
288    });
289  });
290  } else if (window.matchMedia("(min-width:768px)").matches) {
291    //PC処理
292    $(document).ready(function () {
293
294			console.log("test");
295
296        $(function () {
297          const ua = navigator.userAgent;
298          const isSp = (ua.indexOf('iPhone') > -1 || (ua.indexOf('Android') > -1 && ua.indexOf('Mobile') > -1));
299          const isTablet = (ua.indexOf('iPad') > -1 || (ua.indexOf('Android') > -1 && ua.indexOf('Mobile') == -1));
300          const isPc = (! isSp && ! isTablet);
301          if (isPc) {
302            $("#gnav .parent").hover(
303              function () {
304                $(this).addClass("is-active");
305                $(".submenu:not(:animated)", this).slideDown();
306              },
307              function () {
308                $(this).removeClass("is-active");
309                $(".submenu", this).slideUp();
310              }
311            );
312            }
313        })
314
315    });
316  }
317}
318window.onload = switchByWidth;
319window.onresize = switchByWidth;

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.