PageSourceSearch

https://www.ust.ac.kr/template/A/js/acego.gnb.js

js ust.ac.kr collected 2026-10-03 23:05:26 UTC 5,346 bytes, 231 lines download raw bytes

1
2
3function fixed__gnb() {
4    var setHeaderHeight = 40;
5        isHeaderFixed = false;
6    $(window).on("scroll", function(){
7
8
9        if ($(document).scrollTop() > setHeaderHeight) {
10
11            if (!isHeaderFixed) {
12                $("body").addClass("fixed__gnb");
13                isHeaderFixed = true;
14            }
15
16        } else {
17
18            if (isHeaderFixed) {
19                $("body").removeClass("fixed__gnb");
20                isHeaderFixed = false;
21            }
22
23        }
24    });
25
26}
27
28
29function gnb(param,obj,btn,wrap,dur,meth){
30	var param = $(param);
31	var btn = param.find(btn);
32	var obj = param.find(obj);
33	var wrap = $(wrap);
34	var data = false;
35	var elem;
36	var targetHeight = [];
37	var targetHeightResult;
38    var heightResult = btn.outerHeight(true);
39
40
41    function gnb_height(){
42    	$.each(obj,function(idx){
43            targetHeight[idx] = $(this).parent().find(".item").outerHeight(true)+80;
44        });
45        //targetHeightResult = Math.max.apply(null,targetHeight)+80;
46    }
47
48
49    function _open(){
50    	btn.parent().find(".item").removeAttr("style");
51
52    	btn.not(elem).removeClass("current").eq(elem).addClass("current");
53    	obj.not(elem).hide().css({display:"none",opacity:0});
54    	gnb_height();
55    	obj.eq(elem).show().stop().animate({display:"block",opacity:1},{duration: 300,easing:'swing'});
56    	param.stop(true,false).animate({"height":targetHeight[elem]},{duration: 300,easing:'swing'});
57    	param.addClass("open");
58
59    	$("#top_layout").addClass("on");
60	}
61
62
63
64    function _close(){
65    	btn.removeClass("current");
66    	obj.css({display:"none",opacity:0});
67    	param.stop(true,false).animate({"height":heightResult},{duration: 300,easing:'swing'});
68    	param.removeClass("open");
69    	$("#top_layout").removeClass("on");
70	}
71
72
73	btn.on('mouseover focusin', function(){
74		elem = $(this).parent().index();
75		_open();
76
77	});
78
79
80
81	obj.item = obj.find(".depth2_ul");
82	obj.btn = obj.find(".depth2_ul>li>a");
83
84
85
86	//2st
87	obj.item.on("mouseenter focus", function() {
88	    $(this).siblings().removeClass('on').find('*.on').removeClass('on');
89	    $(this).addClass("on");
90    });
91
92
93	obj.btn.on("mouseenter focus",function(){
94		var t = $(this);
95		obj.btn.removeClass("on");
96		t.addClass("on");
97		$(".depth3_ul").hide();
98		t.next().show();
99		t.find(".depth3_ul").show().addClass('open');
100
101
102		if(t.next().is(".depth3_ul")){
103			var th3Height = t.next().outerHeight(true)+btn.outerHeight(true);
104
105			if(th3Height < param.outerHeight()){
106
107				param.stop(true,false).animate({"height":targetHeight[elem]},{duration: 300,easing:'swing'});
108
109			}else{
110				param.stop(true,false).animate({"height":th3Height},{duration: 300,easing:'swing'});
111				return false;
112			}
113			t.parent().parent().height(t.next().innerHeight());
114			return false;
115		}else{
116			param.stop(true,false).animate({"height":targetHeight[elem]},{duration: 300,easing:'swing'});
117		}
118	});
119
120
121
122	/*
123	obj.btn.on("mouseleave",function(){
124		$(this).removeClass("on");
125		$(this).find(".depth3_ul").hide().removeClass('open');
126
127	});
128*/
129
130	obj.btn.next('.depth3_ul').on("mouseenter focus",function(){
131		$(this).addClass("open");
132		obj.btn.removeClass("on");
133		$(this).prev('a').addClass("on");
134	});
135
136
137
138	obj.btn.next('.depth3_ul').on("mouseleave",function(){
139		$(this).removeClass("open");
140		obj.btn.removeClass("on");
141
142		//$(this).prev('a').removeClass("on");
143	});
144
145
146
147	obj.find("a").last().on("focusout",function(){
148		_close();
149		btn.removeClass("current");
150		param.removeClass("open");
151		wrap.removeClass("on");
152	});
153
154
155	wrap.on("mouseleave",function(){
156		_close();
157	});
158
159
160
161}
162
163function gnb_open(){
164	var param = $('#mobile-menu');
165	var str = location.href;
166	var n = 0;
167	var dur = 300;
168	var meth = "easeOutExpo";
169
170	param.find(".depth2_ul").hide();
171  if (param.find(".depth1_ul>.on").length == 0) {
172    param.find(".depth1_ul > .n1 .depth2_ul").show();
173    param.find(".depth1_ul > .n1").addClass("on")
174  	param.find(".depth1_ul > .n1 > a").addClass("ov");
175
176  }else{
177    param.find(".depth1_ul > .on .depth2_ul").show();
178  }
179	
180  param.find(".depth1_ul > .on .depth2_ul > li.on > .depth3_ul").show();
181  
182  var depth3arr = param.find(".depth2_ul>li>.depth3_ul")
183  for (var i = 0; i < depth3arr.length; i++) {
184    depth3arr[i].parentNode.classList.add("in");
185    
186  }
187  
188
189
190	param.find("a").on("click",function(event){
191		if(param.is(":animated") && param.find(":animated").size()){ return false; }
192	});
193
194	function hideMenu() {
195		param.find('.collapse').hide().removeClass('ov');
196	}
197	param.find(".depth1_ul>li>a").on("click",function(event){
198		n = $(this).parent().index();
199		if($(this).next().attr("class").match("depth2_ul")){
200			if($(this).next().css("display") == "none"){
201				param.find(".depth1_ul>li>a").not(n).removeClass("ov").next().stop(true,true).delay(150).slideUp(1
20150);
202				param.find(".depth1_ul>li>a").eq(n).addClass("ov").next().stop(true,true).slideDown(150);
203			}
204		}
205		event.preventDefault();
206	});
207
208	param.find(".depth2_ul>li>a").on("click",function(event){
209		var t = $(this);
210
211		if(t.next().attr("class").match("depth3_ul")){
212			if(t.next().css("display") != "block"){
213				t.addClass("ov");
214				t.next().slideDown(150);
215			}else{
216				t.removeClass("ov");
217				t.next().slideUp(150);
218			}
219
220			event.preventDefault();
221		}
222	});
223
224	$(window).on('resize', function () {
225		$('.mobile-close').click();
226		  $('#gnb_layout').removeAttr('style');
227	});
228
229}
230
231fixed__gnb();

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.