PageSourceSearch

https://www.e-life.co.jp/script_js/common_gimmick.js?ver=5.3.25

js e-life.co.jp collected 2026-09-26 18:07:22 UTC 12,655 bytes, 401 lines download raw bytes

1/* 
2/ ================================================================ 
3/	Copyright(C) E-LIFE CO.,LTD. ALL Right Reserved. 
4/	http://www.e-life.jp/
5/
6/ 2014.07.01 初期作成
7/	※要jquery.js
8/
9/	2021.07.13 function radioToggleCkeck を修正
10/	2021.06.21 function radioToggleCkeck を追加
11/	2021.06.14 function BlockLink(){}を修正
12/	2019.10.24 getIncludeSourceを追加
13/	2019.01.29 adj_scroll()実装
14/	2017.10.02 InpageLinkを修正
15/	2015.07.31 管理動作をユニバーサル対応
16/	2015.07.17 GetScriptParams()実装
17/	2015.07.17 管理タグ変更
18/	2014.10.17 function BlockLink(){}を修正
19/	2014.12.08 function FlatHeightSet{}を追加
20/	2015.03.02 リリース開始
21/
22/ ================================================================ 
23 */
24
25	// Elscript管理設定
26	var filenameElJs	= 'common_gimmick.js';
27	var updatedElJs	=  '20210713';
28	$(function(){
29		EvenOdd();
30		Matrix();
31		ToolTip();
32		InpageLink();
33		BlockLink();
34		HideSeekBtn();
35		ToggleContent();
36		FlatHeightSet();
37		adj_scroll();
38	});
39
40
41/*====================
42function ToggleContent(){}
43 コンテンツの開閉
44
45==========*/
46	function ToggleContent(){
47		if($(".toggle")!=null){
48			$(".toggle_sw").click(function(){
49				$toggleTime = 500;
50				$(this).parent(".toggle").find(".toggle_content").toggle($toggleTime);
51			});
52		}
53	}
54
55/*====================
56function EvenOdd(){
57	tableの奇数/偶数行の色わけ
58	※IE9以降の対応はcss3で対応可能!!
59==========*/
60	function EvenOdd(){
61		if($(".even_odd")!=null){
62			$(".even_odd tr:nth-child(odd)").addClass('odd');
63			$(".even_odd tr:nth-child(even)").addClass('even');		
64		}else{
65			return false;
66		}
67	}
68
69/*====================
70function matrix(){
71	tableのまあ鶏楠表示
72
73==========*/
74	function Matrix(){
75		if($(".matrix")!=null){
76			$('.matrix td').hover(
77				function(){
78					$(this).parent().addClass("over");
79					var currentNum = $(this).index();
80					$('tr',$(this).parent().parent()).each(function(i){
81						$('td',this).eq(currentNum-1).addClass('over');
82					});
83				},
84				function(){
85					$(this).parent().removeClass('over');
86					var currentNum = $(this).index();
87					$('tr',$(this).parent().parent()).each(function(i){
88						$('td',this).eq(currentNum-1).removeClass('over');
89					});
90				}
91			);
92			
93			/*=====
94			マトリックス表示内のクリック動作
95			==========*/
96			$(".matrix td a.clk_fix").click(function () {
97				// 一度全てのaタグから"selected"を削除
98				$(".matrix td a").removeClass('selected');	
99				// 削除後クリックしたaタグに"selected"を付与
100				$(this).addClass('selected');
101			});
102		}
103	}
104
105/*====================
106function ToolTip(){}
107	ツールチップ表示
108==========*/
109	function ToolTip(){
110		$tooltip_speed = 250;
111		if($(".tooltip")!=null){
112			$(".tooltip").hover(function() {
113				//$(this).find(".tooltip_content").not(":animated").animate({opacity: "hide", top: ($tooltip_locate -10) }, $tooltip_speed/2);
114				//$(this).find(".tooltip_content").css("display","block");
115				//$tooltip_parent_h = 0;//$(this).outerHeight();
116				$tooltip_locate = -1 * ($(this).find(".tooltip_content").outerHeight());
117				//$tooltip_locate = -1 * ($tooltip_parent_h + $tooltip_h);
118			
119				$(".tooltip_content").not(":animated").css({opacity: "hide",top: ($tooltip_locate - 5)});
120				$(this).find(".tooltip_content").not(":animated").animate({opacity: "show", top: $tooltip_locate}, $tooltip_speed);
121			},
122				function () {
123					$(".tooltip_content").fadeOut($tooltip_speed/4);
124				}
125			);
126		}
127	}
128
129/*====================
130function HideSeekBtn(){
131	ページ下部のトップへ戻るボタン	
132	ウィンドウ高さを超えたらボタンを表示	
133==========*/
134	function HideSeekBtn(){
135		// ".re_top"存在確認後に動作
136		if($(".re_top")!=null){
137			// ウィンドウの高さを取得
138			$windowHeight = $(window).height();
139			// ウィンドウがリサイズした場合サイズを再取得
140			$(window).resize(function(){
141				$windowHeight = $(window).height();
142			});
143			// fadeIn/Outの時間設定
144			$fadeTime = 350;
145			// スクロール処理 
146			var timer = false;
147			$(window).scroll(function() {
148				$scrollDistance = $(window).scrollTop();
149				if (timer !== false) {
150					clearTimeout(timer);
151				}
152				timer = setTimeout(function() {
153					$scrollDistance = $(window).scrollTop();
154				}, 100);
155				if ($scrollDistance > $windowHeight){
156					$(".re_top").fadeIn($fadeTime);
157				}else if($scrollDistance < $windowHeight){
158					$(".re_top").fadeOut($fadeTime);
159				}
160			});
161		}
162	}
163
164/*==============================
165プルダウンメニュー
166==========*/
167		$("#header_wrap .navi .btn").hover(function() {
168			$(this).children('ul').fadeIn('150');
169		}, function() {
170			$(this).children('ul').hide();
171		});
172
173/*==============================
1742014.06.12
175function InpageLink(){
176	ページ内リンクのスクロール移動
177	他のjsと競合するため、<a>ではなく、class="inpage_link"をキーに動作
178==========*/
179	function InpageLink(){
180		$(".inpage_link").click(function(){
181			$moveTime	= 250; // 何秒掛けてスクロールするか
182			$url		= this.href;
183			if($url.indexOf("#")!=-1){// herfに"#"があったら
184				$url_split		= $url.split("#");
185				$target			= $url_split[1];
186				$target_offset	= $('#' + $target).offset();
187				$destination	= $target_offset.top;
188				/* jQery 1.9から.browser廃止のため使用しない
189				$($.browser.webkit ? 'body' : 'html').animate({scrollTop:0}, $moveTime, "swing"); // コールバックが2回呼ばれるためブラウザ判別
190				*/
191				$userAgent = window.navigator.userAgent.toLowerCase();
192				if($userAgent.indexOf('chrome') != -1 || $userAgent.indexOf('webkit') != -1 ){
193					$('body').animate({scrollTop:$destination}, $moveTime, "swing");
194					// 20171002 chrome 61〜対応のため、,htmlでの記述を併記
195					$('html').animate({scrollTop:$destination}, $moveTime, "swing");
196				}else {
197					$('html').animate({scrollTop:$destination}, $moveTime, "swing");
198				}
199				return false; // アドレスバーにhrefの値を反映しない
200			}
201		});
202	}
203
204/*==============================
2052014.06.12
206function BlockLink(){
207	//divにclass="linkcv"で全体をリンク
2082014.10.17	動作のキーを"linkcv"→"blocklink"へ変更
209==========*/
210	function BlockLink(){
211		$(".blocklink").css('cursor','pointer');
212		//$(".blocklink").click(function(){
213		$(document).on('click','.blocklink',function(){
214			var link_url = $(this).find('a');//$(this)の<a>を要素として指定
215			if (link_url.attr('target') == '_blank') {
216				window.open(link_url.attr('href'));
217			}
218			else window.location = link_url.attr('href');
219			return false;
220		});
221		$(".linkcv").css("cursor","pointer");
222	}
223
224/*====================
2252014.12.08
226function FlatHeight(){}
227 高さの平坦化
228	.flat_wrap内の.flatの高さを揃える
229==========*/
230	function FlatHeightSet(){
231		// ページ読み込み時に処理
232		FlatHeight();
233		$(window).on("orientationchange",	function (){FlatHeight();});//orientationchange=向きが変わったら"sizeReset()"を実行
234		$(window).resize(function (){FlatHeight();});//resize=ウィンドウの大きさが変更された時に"sizeReset()"を実行
235	}
236	function FlatHeight(){
237		$('.flat_wrap').each(function() {
238			$(this).find(".flat").css({"height":"initial","height":"auto"});
239			// 高さは.flatの中で一番高い物を設定
240			$FlatHeight = 0;
241			$(this).find(".flat").each(function(i) {
242				if($FlatHeight < $(this).height()) {
243					$FlatHeight = $(this).height();
244				}		
245			});
246			$(this).find(".flat").css('height',$FlatHeight+'px');
247		});
248	}
249
250/*==========
251function GetScriptParams();
252htmlから読み込ませたファイル記述のパラメータから値を取得
253==============================*/	
254	function GetScriptParams(file_name){
255		var scripts		= document.getElementsByTagName('script');
256		$this_src			= '';
257		$.each(scripts, function(i, val) {
258			var src		= val.src;
259			if(src.indexOf(file_name) != -1) {
260				$this_src	=	src;
261			}
262		});
263		if ($this_src != ''){
264			var query = $this_src.substring($this_src.indexOf('?')+1);
265			var parameters = query.split('&');
266			// URLクエリを分解して取得する
267			var result = new Object();
268			for(var i = 0; i < parameters.length; i++){
269				var element = parameters[i].split('=');
270				var paramName = decodeURIComponent( element[0]);
271				var paramValue = decodeURIComponent( element[1]);
272				result[paramName] = paramValue;
273			}
274		}
275		return result;
276	}
277
278/*==========
279function adj_scroll();
280IEでスクロール時に線が入るのを改善
281==============================*/
282	function adj_scroll(){
283		if($('body').hasClass('adj_scroll')){
284			$(window).scroll( function(){
285				$("body").css({'background-position':'0 0','opacity':0.9});
286				var timer = false;
287				if(timer !== false ){
288					clearTimeout(timer);
289				}
290				timer = setTimeout( function(){
291					$("body").css({'background-position':'0 0','opacity':1});
292				}, 100);
293			});	
294		}	
295	}
296
297/*==========
298getIncludeSource
299遅延ローディング用の処理
300========================================*/
301	function getIncludeSource(target,add_type,url,callback_func){
302		/*
303		append()
304		appendTo()
305		prepend()
306		prependTo()
307		after()
308		insertAfter()
309		before()
310		insertBefore()
311		*/
312		if(url.indexOf('http') != -1) {
313			//url	= url;
314		}else {
315			url	= $(location).attr('protocol')+"//"+$(location).attr('host')+url;
316		}
317		$.ajax({
318			type	: "GET",
319			url		: url,
320			dataTye	: "html",
321			sync	: false,
322			cache	: false
323		}).then(
324			// 1つめは成功時のコールバック
325			function (data) {
326				if(add_type=="append"){
327					$(target).append(data);
328				}else if(add_type=="appendto"){
329					$(data).appendTo(target);
330				}else if(add_type=="prepend"){
331					$(target).prepend(data);
332				}else if(add_type=="prependto"){
333					$(data).prependTo(target);
334				}else if(add_type=="after"){
335					$(target).after(data);
336				}else if(add_type=="insertafter"){
337					$(data).insertAfter(target);
338				}else if(add_type=="before"){
339					$(target).before(data);
340				}else if(add_type=="insertbefore"){
341					$(data).insertBefore(target);
342				}
343				if(callback_func!=""){
344					callback_func();
345				}
346			},
347			// 2つめは通信失敗時のコールバック
348			function () {
349				console.log("get ajax false!!!!!!!");
350			}
351		);
352	}
353
354/*==========
355radioToggleCkeck
356ラジオボタンのチェック制御
357========================================*/
358	function radioToggleCkeck(target){
359		$target_array=target.split(',');
360		$checkedRadioValue = new Array;
361		$.each($target_array, function(i, val){
362			// チェック済みの初期値をリストに保存しておく
363			if (typeof $('[name="'+val+'"]:checked').val()=== "undefined") {
364				var checked_val = '';
365			}else {
366				var checked_val =$('[name="'+val+'"]:checked').val();
367			}
368			$checkedRadioValue[val]=checked_val;
369			$($('[name="'+val+'"]')).on('click',function(){
370				var value = $('[name="'+val+'"]:checked').val();
371				if ($checkedRadioValue[val] === value) {
372					// 保存済の値が自分だったらチェックを解除し値を空に
373					$checkedRadioValue[val] = '';
374					$(this).prop('checked', false);
375				} else {
376					// 保存済の自分でなかったら値を上書き
377					$checkedRadioValue[val] = value;
378				}
379			});
380		})
381	}
382
383// js設置管理用
384	$(function(){
385		$('script').each(function(index) {
386			$source = $(this).html();
387			$ga_cnt=1;
388			if($source.indexOf("ga('send', 'pageview');") != -1){
389				if($source.indexOf("var ana_scripts") == -1){
390					$re_source	=	"ga('create', 'UA-44494306-5', 'auto', {'name': 'newTracker'});ga('newTracker.send', 'event', location.hostname, filenameElJs, updatedElJs);"
391					var script	=	document.createElement("script");
392					script.innerHTML = $re_source;
393					$("head").append(script);
394					$ga_cnt++;
395				}
396			}
397		});
398		if($ga_cnt==0){
vendor: 328 bytes, lines 398-399
398
399			(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', '
399UA-44494306-5
vendor: 34 bytes, line 399
399', 'auto', {'allowLinker': true});
399ga('require', 'linker');ga('send', 'event', location.hostname, filenameElJs, updatedElJs);	
400		}
401	});

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.