PageSourceSearch

https://www.city.higashiomi.shiga.jp/_template_/_site_/_default_/_res/js/dropdown_menu.js

js city.higashiomi.shiga.jp collected 2026-10-02 06:13:31 UTC 5,130 bytes, 165 lines download raw bytes

1//------------------------------------------------------------------------------
2//	ドロップダウンメニュー
3//	Copyright (C) 2012 FUTUREINN CO., LTD. All Rights Reserved.
4//------------------------------------------------------------------------------
5(function(){
6var $ = FI.jQuery;
7$(function(){
8	if(!$(".smpmode").length){
9		$('.scate').each(function(){
10			var $scate = $(this);
11			var $ul = $(this).children('*').not('.tismenu');
12			var target = $('.scate .navi');
13			var target2 = $('.scate .tismenu');
14			var target3 = $('.scate');
15			$ul.hide();
16			$('.tismenu',this).on('click', function() {
17				//自分以外の処理
18				var self = $(this).next("div");
19				target.not(self).hide().prev().removeClass("choice");
20				target3.not(self).removeClass("choice");
21				target.not(self).hide().prev().children().attr('aria-expanded', 'false');
22				target.not(self).hide().attr('aria-hidden', 'true');
23				
24				//自分の処理
25				$ul.slideToggle();
26				$scate.addClass("choice");
27				$(this).toggleClass("choice");
28				//WAI-ARIA
29				if($(this).hasClass("choice")){
30					$(this).attr('aria-expanded', 'true');
31					$(this).next().attr('aria-hidden', 'false');
32				}else{
33					$(this).attr('aria-expanded', 'false');
34					$(this).next().attr('aria-hidden', 'true');
35				}
36			});
37			
38			//.naviからフォーカスが外れたら閉じる
39			$("#gnavi .navi ul li:last-child").on('focusout', function() {
40				$ul.slideUp();
41				$scate.removeClass("choice");
42				$(".scate .tismenu").removeClass("choice");
43				$(".scate .tismenu").attr('aria-expanded', 'false');
44				$(target).attr('aria-hidden', 'true');
45			})
46			
47			//閉じるボタン
48			$('.gnaviclose').on('click', null, function() {
49				$ul.slideUp();
50				$scate.removeClass("choice");
51				$(".scate .tismenu").removeClass("choice");
52				$(".scate .tismenu").attr('aria-expanded', 'false');
53				$(target).attr('aria-hidden', 'true');
54			});
55		});
56	}
57
58	//---------------------------------------------------------------------------
59	//【行政】いざというとき/目的別検索(PC/スマホ)
60	
61	if(!FI.sm){
62	$('#smpmenup1.bmenu , #smpmenup2.bmenu').each(function(){
63		var $ul2 = $(this).children('*').not('.hnmenu');
64		
65		$ul2.hide();
66		$(this).toggleClass("pscatenone");
67		
68		//リンク名称を「閉じる」にする
69		//メニュー名を記憶
70	//	$smpmenup2text = $("#smpmenup2 .hnmenu span").text();
71	//	$smpmenup1text = $("#smpmenup1 .hnmenu span").text();
72	//	closeText = function(){
73	//		if($("#smpmenup2 .choice").length){
74	//			$("#smpmenup2 .hnmenu span").text("閉じる");
75	//		}else{
76	//			$("#smpmenup2 .hnmenu span").text($smpmenup2text);
77	//		}
78	//		if($("#smpmenup1 .choice").length){
79	//			$("#smpmenup1 .hnmenu spann").text("閉じる");
80	//		}else{
81	//			$("#smpmenup1 .hnmenu span").text($smpmenup1text);
82	//		}
83	//	}
84
85		$('.hnmenu',this).on('click', function() {
86			//ボトムナビ(いざ、目的別)をクリックしたら
87			$ul2.slideToggle();
88			$(this).toggleClass("choice");
89			$(this).attr('aria-expanded', 'true');
90			$(this).next().attr('aria-hidden', 'false');
91			$(this).parents('.bmenu').toggleClass("pscatenone");
92	//		closeText();
93			if(FI.sm){
94					bodyopen();
95					gnavismpheight();
96			}
97			
98			//WAI-ARIA
99			if(!$(this).hasClass("choice")){
100				$(this).attr('aria-expanded', 'false');
101				$(this).next().attr('aria-hidden', 'true');
102			}
103			
104			//他を閉じる
105			menuSwitch = function($id){
106				if($('#' + $id + ' .hnmenu').hasClass('choice')){
107					$('#' + $id + '.bmenu').children('*').not('.bmenu .hnmenu').slideUp();
108					$('#' + $id + '.bmenu .hnmenu').removeClass("choice");
109					$('#' + $id + '.bmenu .hnmenu').attr('aria-expanded', 'false');
110					$('#' + $id + ' .navi').attr('aria-hidden', 'true');
111			//		closeText();
112					if(FI.sm){
113						bodyopen();
114						gnavismpheight();
115					}
116				}
117			}
118			
119			//メニュー(グローバルメニュー)をクリックしたときにボトムナビ(いざ、目的別)を閉じる
120			if(FI.sm){
121				$('#smpmenu .hnmenu').on('click', function() {
122					menuSwitch("smpmenup1");
123					menuSwitch("smpmenup2");
124				});
125			}
126			//smpmenup1をクリックしたときに他を閉じる
127			$('#smpmenup1 .hnmenu').on('click', function() {
128				menuSwitch("smpmenup2");
129			//	closeText();
130			});
131			//smpmenup2をクリックしたときに他を閉じる
132			$('#smpmenup2 .hnmenu').on('click', function() {
133				menuSwitch("smpmenup1");
134			//	closeText();
135			});	
136			
137		});
138
139		//閉じるボタンを押したら閉じる
140		$('.psclose').on('click', null, function() {
141			$ul2.slideUp();
142			
143			$(".bmenu .hnmenu").removeClass("choice");
144			$(".bmenu .hnmenu").attr('aria-expanded', 'false');
145			$(this).parents('.navi').attr('aria-hidden', 'true');
146			
147		//	closeText();
148		});
149
150		//ボトムナビ(いざ、目的別)をクリックしたときにメニュー(グローバルメニュー)が開いていたら閉じる
151		//グローバルメニューの処理はsmp.jsに記載
152		if(FI.sm){
153			$('#jssmpbtmnavi .hnmenu').on('click', function() {
154				if(hnFlg){
155					menuClose();
156					return false;
157				}
158			});
159		}
160
161	});
162	}
163
164});
165})();

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.