PageSourceSearch

https://www.hoyuu.com/js/common_gimmick.js

js hoyuu.com collected 2026-09-30 23:09:31 UTC 9,511 bytes, 287 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/	2015.07.31 管理動作をユニバーサル対応
10/	2015.07.17 GetScriptParams()実装
11/	2015.07.17 管理タグ変更
12/	2014.10.17 function BlockLink(){}を修正
13/	2014.12.08 function FlatHeightSet{}を追加
14/	2015.03.02 リリース開始
15/ ================================================================ 
16 */
17
18	// Elscript管理設定
19	var filenameElJs	= 'common_gimmick.js';
20	var updatedElJs	=  '20150731';
21	$(function(){
22		EvenOdd();
23		Matrix();
24		ToolTip();
25		InpageLink();
26		BlockLink();
27		HideSeekBtn();
28		ToggleContent();
29		FlatHeightSet();
30	});
31
32
33/*====================
34function ToggleContent(){}
35 コンテンツの開閉
36
37==========*/
38	function ToggleContent(){
39		if($(".toggle")!=null){
40			$(".toggle_sw").click(function(){
41				$toggleTime = 500;
42				$(this).parent(".toggle").find(".toggle_content").toggle($toggleTime);
43			});
44		}
45	}
46
47/*====================
48function EvenOdd(){
49	tableの奇数/偶数行の色わけ
50	※IE9以降の対応はcss3で対応可能!!
51==========*/
52	function EvenOdd(){
53		if($(".even_odd")!=null){
54			$(".even_odd tr:nth-child(odd)").addClass('odd');
55			$(".even_odd tr:nth-child(even)").addClass('even');		
56		}else{
57			return false;
58		}
59	}
60
61/*====================
62function matrix(){
63	tableのまあ鶏楠表示
64
65==========*/
66	function Matrix(){
67		if($(".matrix")!=null){
68			$('.matrix td').hover(
69				function(){
70					$(this).parent().addClass("over");
71					var currentNum = $(this).index();
72					$('tr',$(this).parent().parent()).each(function(i){
73						$('td',this).eq(currentNum-1).addClass('over');
74					});
75				},
76				function(){
77					$(this).parent().removeClass('over');
78					var currentNum = $(this).index();
79					$('tr',$(this).parent().parent()).each(function(i){
80						$('td',this).eq(currentNum-1).removeClass('over');
81					});
82				}
83			);
84			
85			/*=====
86			マトリックス表示内のクリック動作
87			==========*/
88			$(".matrix td a.clk_fix").click(function () {
89				// 一度全てのaタグから"selected"を削除
90				$(".matrix td a").removeClass('selected');	
91				// 削除後クリックしたaタグに"selected"を付与
92				$(this).addClass('selected');
93			});
94		}
95	}
96
97/*====================
98function ToolTip(){}
99	ツールチップ表示
100==========*/
101	function ToolTip(){
102		$tooltip_speed = 250;
103		if($(".tooltip")!=null){
104			$(".tooltip").hover(function() {
105				//$(this).find(".tooltip_content").not(":animated").animate({opacity: "hide", top: ($tooltip_locate -10) }, $tooltip_speed/2);
106				//$(this).find(".tooltip_content").css("display","block");
107				//$tooltip_parent_h = 0;//$(this).outerHeight();
108				$tooltip_locate = -1 * ($(this).find(".tooltip_content").outerHeight());
109				//$tooltip_locate = -1 * ($tooltip_parent_h + $tooltip_h);
110			
111				$(".tooltip_content").not(":animated").css({opacity: "hide",top: ($tooltip_locate - 5)});
112				$(this).find(".tooltip_content").not(":animated").animate({opacity: "show", top: $tooltip_locate}, $tooltip_speed);
113			},
114				function () {
115					$(".tooltip_content").fadeOut($tooltip_speed/4);
116				}
117			);
118		}
119	}
120
121/*====================
122function HideSeekBtn(){
123	ページ下部のトップへ戻るボタン	
124	ウィンドウ高さを超えたらボタンを表示	
125==========*/
126	function HideSeekBtn(){
127		// ".re_top"存在確認後に動作
128		if($(".re_top")!=null){
129			// ウィンドウの高さを取得
130			$windowHeight = $(window).height();
131			// ウィンドウがリサイズした場合サイズを再取得
132			$(window).resize(function(){
133				$windowHeight = $(window).height();
134			});
135			// fadeIn/Outの時間設定
136			$fadeTime = 350;
137			// スクロール処理 
138			var timer = false;
139			$(window).scroll(function() {
140				$scrollDistance = $(window).scrollTop();
141				if (timer !== false) {
142					clearTimeout(timer);
143				}
144				timer = setTimeout(function() {
145					$scrollDistance = $(window).scrollTop();
146				}, 100);
147				if ($scrollDistance > $windowHeight){
148					$(".re_top").fadeIn($fadeTime);
149				}else if($scrollDistance < $windowHeight){
150					$(".re_top").fadeOut($fadeTime);
151				}
152			});
153		}
154	}
155
156/*==============================
157プルダウンメニュー
158==========*/
159		$("#header_wrap .navi .btn").hover(function() {
160			$(this).children('ul').fadeIn('150');
161		}, function() {
162			$(this).children('ul').hide();
163		});
164
165/*==============================
1662014.06.12
167function InpageLink(){
168	ページ内リンクのスクロール移動
169	他のjsと競合するため、<a>ではなく、class="inpage_link"をキーに動作
170==========*/
171	function InpageLink(){
172		$(".inpage_link").click(function(){
173			$moveTime	= 250; // 何秒掛けてスクロールするか
174			$url		= this.href;
175			if($url.indexOf("#")!=-1){// herfに"#"があったら
176				$url_split		= $url.split("#");
177				$target			= $url_split[1];
178				$target_offset	= $('#' + $target).offset();
179				$destination	= $target_offset.top;
180				/* jQery 1.9から.browser廃止のため使用しない
181				$($.browser.webkit ? 'body' : 'html').animate({scrollTop:0}, $moveTime, "swing"); // コールバックが2回呼ばれるためブラウザ判別
182				*/
183				$userAgent = window.navigator.userAgent.toLowerCase();
184				if($userAgent.indexOf('chrome') != -1 || $userAgent.indexOf('webkit') != -1 ){
185					$('body').animate({scrollTop:$destination}, $moveTime, "swing");
186                                        // 20171002 chrome 61〜対応のため、,htmlでの記述を併記
187                                        $('html').animate({scrollTop:$destination}, $moveTime, "swing");
188				}else {
189					$('html').animate({scrollTop:$destination}, $moveTime, "swing");
190				}
191				return false; // アドレスバーにhrefの値を反映しない
192			}
193		});
194	}
195
196/*==============================
1972014.06.12
198function BlockLink(){
199	//divにclass="linkcv"で全体をリンク
2002014.10.17	動作のキーを"linkcv"→"blocklink"へ変更
201==========*/
202	function BlockLink(){
203		 $(".blocklink").css('cursor','pointer');
204		 $(".blocklink").click(function(){
205			var link_url = $(this).find('a');//$(this)の<a>を要素として指定
206			if (link_url.attr('target') == '_blank') {
207				window.open(link_url.attr('href'));
208			}
209			else window.location = link_url.attr('href');
210			return false;
211		});
212		$(".linkcv").css("cursor","pointer");
213	}
214
215/*====================
2162014.12.08
217function FlatHeight(){}
218 高さの平坦化
219	.flat_wrap内の.flatの高さを揃える
220==========*/
221	function FlatHeightSet(){
222		// ページ読み込み時に処理
223		FlatHeight();
224		$(window).on("orientationchange",	function (){FlatHeight();});//orientationchange=向きが変わったら"sizeReset()"を実行
225		$(window).resize(function (){FlatHeight();});//resize=ウィンドウの大きさが変更された時に"sizeReset()"を実行
226	}
227	function FlatHeight(){
228		$('.flat_wrap').each(function() {
229			$(this).find(".flat").css({"height":"initial","height":"auto"});
230			// 高さは.flatの中で一番高い物を設定
231			$FlatHeight = 0;
232			$(this).find(".flat").each(function(i) {
233				if($FlatHeight < $(this).height()) {
234					$FlatHeight = $(this).height();
235				}		
236			});
237			$(this).find(".flat").css('height',$FlatHeight+'px');
238		});
239	}
240
241/*==========
242function GetScriptParams();
243htmlから読み込ませたファイル記述のパラメータから値を取得
244==============================*/	
245	function GetScriptParams(file_name){
246		var scripts		= document.getElementsByTagName('script');
247		$this_src			= '';
248		$.each(scripts, function(i, val) {
249			var src		= val.src;
250			if(src.indexOf(file_name) != -1) {
251				$this_src	=	src;
252			}
253		});
254		if ($this_src != ''){
255			var query = $this_src.substring($this_src.indexOf('?')+1);
256			var parameters = query.split('&');
257			// URLクエリを分解して取得する
258			var result = new Object();
259			for(var i = 0; i < parameters.length; i++){
260				var element = parameters[i].split('=');
261				var paramName = decodeURIComponent( element[0]);
262				var paramValue = decodeURIComponent( element[1]);
263				result[paramName] = paramValue;
264			}
265		}
266		return result;
267	}
268
269// js設置管理用
270	$(function(){
271		$('script').each(function(index) {
272			$source = $(this).html();
273			$ga_cnt=1;
274			if($source.indexOf("ga('send', 'pageview');") != -1){
275				if($source.indexOf("var ana_scripts") == -1){
276					$re_source	=	"ga('create', 'UA-44494306-5', 'auto', {'name': 'newTracker'});ga('newTracker.send', 'event', location.hostname, filenameElJs, updatedElJs);"
277					var script	=	document.createElement("script");
278					script.innerHTML = $re_source;
279					$("head").append(script);
280					$ga_cnt++;
281				}
282			}
283		});
284		if($ga_cnt==0){
vendor: 328 bytes, lines 284-285
284
285			(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', '
285UA-44494306-5
vendor: 34 bytes, line 285
285', 'auto', {'allowLinker': true});
285ga('require', 'linker');ga('send', 'event', location.hostname, filenameElJs, updatedElJs);	
286		}
287	});

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.