PageSourceSearch

https://www.city.miura.kanagawa.jp/theme/base/js/jquery_dropmenu.js

js city.miura.kanagawa.jp collected 2026-10-02 15:00:39 UTC 2,406 bytes, 106 lines download raw bytes

1	/*
2	* ドロップメニュ
3	  必須ライブラリ:eqGroupHeight
4	*/
5	$.fn.dropMenu = function(config) {
6		config = jQuery.extend({
7			col: 1
8		},config);
9		var target = this;
10		
11		if(target.size() == 0) {
12			return;
13		}
14		
15		var lies = target.find('.list li');
16		var divs = target.find('.list .dropmenu');
17		var notA = $('a').not(target.find('a'));
18		
19		var z = 0;
20		
21		var show = function() {
22			var a = $(this);
23			divs.hide();
24			a.data('div').fadeIn(200 ,function() {
25				target.find(".list2").eqGroupHeight(2);
26			});
27			// ie8はabsoluteしたliは親要素が透明化しても透明化されないので自身も透明化
28			a.data('lies').hide();
29			// a.data('lies').fadeIn(150);
30			// 上記のeqGroupHeightが間に合わないので時間短めにする(liの高さが0になる)
31			a.data('lies').slideDown(150);
32			
33			z++;
34			a.data('li').css('z-index', z);
35			
36			target.find(".list2").css('top', target.height() + 'px');
37		};
38		var hide = function() {
39			divs.fadeOut(150, function() {
40				$("#header-nav .list2 li").css('height', 'auto');
41			});
42			var a = $(this);
43			if(a.data('lies')) {
44				a.data('lies').slideUp(150);
45				// a.data('lies').fadeOut(150);
46			}
47		};
48		
49		var targetR = target.offset().left + target.width();
50		lies.each(function(){
51			var li = $(this);
52			var div = li.find('.dropmenu');
53			var lies = li.find('.list2 li');
54			var a = li.find('> a');
55			
56			if(div.size() == 0) {
57			    return true;
58			}
59			
60			var aFocusShow = function() {
61			    $(this).addClass('focus');
62			}
63			var aFocusHide = function() {
64			    $(this).removeClass('focus');
65			}
66			div.find('a').each(function() {
67			    var a = $(this);
68    			a.focusin(aFocusShow);
69    			a.focusout(aFocusHide);
70    			a.hover(aFocusShow, aFocusHide);
71			});
72			
73			div.show();//計算するため
74			var divR = div.offset().left + div.width();
75			if(targetR < divR) {
76				div.css("right", "0px");
77				div.css("left", "auto");
78				div.addClass('R');
79			}
80			div.hide();
81			
82			li.data('a', a);
83			li.data('div', div);
84			li.data('lies', lies);
85			li.data('li', li);
86			a.data('a', a);
87			a.data('div', div);
88			a.data('lies', lies);
89			a.data('li', li);
90
91			if(div.find('a').size() > 0) {
92				a.focus(show);
93				li.hover(show, hide);
94				notA.focus(hide);
95
96
97			}
98			
99
100
101			
102		});
103	};
104	
105	
106

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.