PageSourceSearch

https://www.yumotokan.co.jp/common/js/jquery.tab.js

js yumotokan.co.jp collected 2026-09-26 04:14:34 UTC 1,614 bytes, 60 lines download raw bytes

1$(function() {
2	// urlパラメータの取得
3	var searchArg = new Object;
4	var searchPrm = location.search.substring(1).split('&');
5	for(var i=0 ; searchPrm[i] ; i++) {
6		var kv = searchPrm[i].split('=');
7		searchArg[kv[0]]=kv[1];
8	}
9
10	// 連動タブを配列に格納
11	var pairArg = new Object;
12	$('ul[data-pairing]').each(function() {
13		var pairName = $(this).attr('data-pairing');
14		if(!pairArg[pairName]) {
15			pairArg[pairName] = $();
16		}
17
18		pairArg[pairName] = pairArg[pairName].add($(this));
19	});
20
21	$('.tabs a[href^="#sec7_panel"]').on('click', function(e){
22
23		if(!$(this).attr('onclick')) {	// タブ → タブ のリンク判定
24			$(this).closest('.tabs').children('.panel').hide();
25
26			// class名の付け外し
27			var navObj = $(this).closest('ul');
28
29			// 連動タブがある場合は格納しておいたオブジェクトで操作する
30			if(navObj.attr('data-pairing')) {
31				navObj = $(pairArg[navObj.attr('data-pairing')]);
32			}
33
34			navObj.find('a').removeClass('active');
35			navObj.find('a[href="'+ this.hash +'"]').addClass("active");
36
37			$(this.hash).fadeIn();
38		}
39
40		return false;
41	});
42
43	// 別ページから飛んだ時にtabパラメータが指定されている場合
44	if(searchArg['tab']){
45		tabMove(searchArg['tab']);
46	}
47});
48
49// タブ以外の箇所からのリンク用関数
50function tabMove(hash) {
51	var tabArg = hash.split(',');
52
53	$.each(tabArg, function() {
54		openHash = this.replace(/\s+/g, "");
55
56		// .tabs内に同じトリガーが複数ある場合は一つ目のみ実行する
57		$('.tabs a[href^="#' + openHash + '"]').eq(0).trigger('click');
58	});
59	return false;
60}

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.