PageSourceSearch

https://www.terusengyo.com/assets_add/js/20230518.js

js terusengyo.com collected 2026-10-05 11:45:21 UTC 1,866 bytes, 77 lines download raw bytes

1
2window.addEventListener('DOMContentLoaded', (event) => {
3
4var $window = $(window);
5var $document = $(document);
6var $html = $('html');
7var $body = $('body');
8
9$(function(){
10	//タブ切り替え
11	var tab = '[data-tab]';
12	var tab_btn = '[data-tab-button]';
13	var tab_panel = '[data-tab-panel]';
14	var $tab = $(tab);
15
16	if( !$tab.length ) return;
17
18	$tab.on('select', tab_btn, function(e){ //判定
19		var btn = $(this).closest(tab).find(tab_btn);
20		var panel = $(this).closest(tab).find(tab_panel);
21		var index = btn.index($(this));
22
23		//ボタンの属性変更
24		btn.attr({ 'tabindex': '-1', 'aria-selected': false });
25		$(this).attr({ 'tabindex': '0', 'aria-selected': true });
26
27		//パネルの属性変更
28		panel.attr({ 'aria-hidden': true });
29		panel.eq(index).attr({ 'aria-hidden': false });
30	});
31	function setScrollTop(top) {
32		var tgt;
33		if ('scrollingElement' in document) {
34			tgt = document.scrollingElement;
35		} else if (this.browser.isWebKit) {
36			tgt = document.body;
37		} else {
38			tgt = document.documentElement;
39		}
40		tgt.scrollTop = top;
41	}
42	//if(location.hash && $(location.hash).length){//読み込み時
43	//	var $location = $(tab_btn+'[href="'+location.hash+'"]');
44	//	$location.focus().trigger('select');
45	//	$(window).on('load',function(){
46	//		var pos = $location.offset().top;
47	//		setScrollTop(pos);
48	//	});
49	//}
50
51	$(tab_btn).on('click', function(e){//クリック時
52		$(this).trigger('select');
53		return false;
54	});
55
56	$tab.on('keyup', tab_btn, function(e) {//左右操作時
57		var $prev = $(this).parent().prev().children();
58		var $next = $(this).parent().next().children();
59		var $target;
60		switch (e.keyCode) {
61			case 37:
62			$target = $prev;
63			break;
64			case 39:
65			$target = $next;
66			break;
67			default:
68			$target = false;
69			break;
70		}
71		if ($target.length) {
72			$target.focus().trigger('select');
73		}
74	});
75}());
76
77});//DOMContentLoaded

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.