PageSourceSearch

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

js city.hanamaki.iwate.jp collected 2026-10-02 05:45:59 UTC 3,410 bytes, 105 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	//---------------------------------------------------------------------------
9	//グローバルナビ(PCのみ)
10	if(!$(".smpmode").size() > 0){
11		$('.scate').each(function(){
12			var $ul = $(this).children('*').not('.tismenu');
13			var target = $('.scate .navi');
14			var target2 = $('.scate .tismenu');
15			$ul.hide();
16			$('.tismenu',this).click(function(){
17				//自分以外の処理
18				var self = $(this).next("div");
19				target.not(self).hide().prev().removeClass("choice");
20				target.not(self).hide().prev().children().attr('aria-expanded', 'false');
21				target.not(self).hide().attr('aria-hidden', 'true');
22				
23				//自分の処理
24				$ul.slideToggle();
25				$(this).toggleClass("choice");
26				//WAI-ARIA
27				if($(this).hasClass("choice")){
28					$(this).children().attr('aria-expanded', 'true');
29					$(this).next().attr('aria-hidden', 'false');
30				}else{
31					$(this).children().attr('aria-expanded', 'false');
32					$(this).next().attr('aria-hidden', 'true');
33				}
34			});
35			
36			//.naviからフォーカスが外れたら閉じる
37			$("#gnavi .navi ul li:last-child").focusout(function(){
38				$ul.slideUp();
39				$(".scate h2").removeClass("choice");
40				$(".scate h2 a").attr('aria-expanded', 'false');
41				$(target).attr('aria-hidden', 'true');
42			})
43			
44			//閉じるボタン
45			$('.gnaviclose').click(null,function() {
46				$ul.slideUp();
47				$(".scate h2").removeClass("choice");
48				$(".scate h2 a").attr('aria-expanded', 'false');
49				$(target).attr('aria-hidden', 'true');
50			});
51		});
52	}
53	
54	
55	//---------------------------------------------------------------------------
56	//目的で探す(PC/スマホ)
57	$('#target .pscate').each(function(){
58		var $ul2 = $(this).children('*').not('.pscate .tismenu');
59		var target3 = $('#target .pscate .navi');
60		var target4 = $('#target .pscate .tismenu');
61		$ul2.hide();
62		$('#target h2.tismenu').click(function(){
63
64			//自分の処理
65			$ul2.slideToggle();
66			$(this).toggleClass("choice");
67			//WAI-ARIA
68			if($(this).hasClass("choice")){
69				$(this).children().attr('aria-expanded', 'true');
70				$(this).next().attr('aria-hidden', 'false');
71			}else{
72				$(this).children().attr('aria-expanded', 'false');
73				$(this).next().attr('aria-hidden', 'true');
74			}
75		});
76
77		//.naviからフォーカスが外れたら閉じる
78		$("#target ul li:last").focusout(function(){
79			$ul2.slideUp();
80			$(".pscate h2").removeClass("choice");
81			$(".pscate h2 a").attr('aria-expanded', 'false');
82			$(target3).attr('aria-hidden', 'true');
83		})
84
85		//閉じるボタン
86		$('.gnaviclose').click(null,function() {
87			$ul2.slideUp();
88			$(".pscate h2").removeClass("choice");
89			$(".pscate h2 a").attr('aria-expanded', 'false');
90			$(target3).attr('aria-hidden', 'true');
91		});
92		//閉じるボタン
93		$('#wrap #smpmenu button').click(null,function() {
94			$ul2.slideUp();
95			$(".pscate h2").removeClass("choice");
96			$(".pscate h2 a").attr('aria-expanded', 'false');
97			$(target3).attr('aria-hidden', 'true');
98		});
99	});
100	
101	
102});
103})();
104
105

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.