PageSourceSearch

https://www.city.morioka.iwate.jp/_template_/_site_/_default_/_res/js/dropdown_menu.js

js city.morioka.iwate.jp collected 2026-09-24 19:12:49 UTC 4,641 bytes, 147 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($("#gnavi").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).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").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').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	//---------------------------------------------------------------------------
60	//【行政】目的別検索(PC/スマホ)
61	$('#hpurpose .pscate').each(function(){
62		var $ul2 = $(this).children('*').not('.pscate .tismenu');
63		
64		$ul2.hide();
65		$(this).toggleClass("pscatenone");
66		
67		//PCのとき
68		if(!FI.sm){
69			//ウィンドウの高さが小さいとき、#hpurposemenuの高さをウィンドウの高さに合わせる
70			var wh = $(window).height();
71			var menuh = $("#target #hpurposemenu").outerHeight()
72			var top = $('#target').css('top');
73			top = parseInt(top);
74			var whtop = wh - top;
75			if(whtop < menuh){
76				$("#target #hpurposemenu").css("height",whtop);
77			}
78		}
79		
80		$('.tismenu',this).click(function(){
81			//ボトムナビ(目的別)をクリックしたら
82			$ul2.slideToggle();
83			$(this).toggleClass("choice");
84			$(this).attr('aria-expanded', 'true');
85			$(this).next().attr('aria-hidden', 'false');
86			$(this).parents('.pscate').toggleClass("pscatenone");
87			if(FI.sm){
88				bodyopen();
89				gnavismpheight();
90			}
91			
92			//WAI-ARIA
93			if(!$(this).hasClass("choice")){
94				$(this).attr('aria-expanded', 'false');
95				$(this).next().attr('aria-hidden', 'true');
96			}
97			
98			//他を閉じる
99			menuSwitch = function($id){
100				if($('#' + $id + ' .tismenu').hasClass('choice')){
101					$('#' + $id + ' .pscate').children('*').not('.pscate .tismenu').slideUp();
102					$('#' + $id + ' .pscate .tismenu').removeClass("choice");
103					$('#' + $id + ' .pscate .tismenu').attr('aria-expanded', 'false');
104					$('#' + $id + ' .navi').attr('aria-hidden', 'true');
105					if(FI.sm){
106						bodyopen();
107						gnavismpheight();
108					}
109				}
110			}
111			
112			//メニュー(グローバルメニュー)をクリックしたときにボトムナビ(目的別)を閉じる
113			if(FI.sm){
114				$('#smpmenu button').click(function() {
115					menuSwitch("hpurpose");
116				});
117			}
118		});
119
120		//閉じるボタンを押したら閉じる
121		$('.psclose').click(null,function(){
122			$ul2.slideUp();
123			if(FI.sm){
124				bodyopen();
125				gnavismpheight();
126			}
127			
128			$(".pscate .tismenu").removeClass("choice");
129			$(".pscate .tismenu").attr('aria-expanded', 'false');
130			$(this).parents('.navi').attr('aria-hidden', 'true');
131		});
132
133		//ボトムナビ(いざ、目的別)をクリックしたときにメニュー(グローバルメニュー)が開いていたら閉じる
134		//グローバルメニューの処理はsmp.jsに記載
135		if(FI.sm){
136			$('#jssmpbtmnavi .tismenu').click(function() {
137				if(hnFlg){
138					menuClose();
139					return false;
140				}
141			});
142		}
143	});
144	
145	
146});
147})();

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.