PageSourceSearch

https://gwangyang.go.kr/tour/js/common.js

js gwangyang.go.kr collected 2026-10-02 07:32:31 UTC 11,246 bytes, 355 lines download raw bytes

1$(function(){
2
3	if($(window).scrollTop() > 0){
4		$("#header").addClass("active");
5	}
6
7	if(location.search.slice(-12) == 'a30800000000') {
8		$("#header").addClass("active");
9	}
10
11	$(window).on("scroll", function(){
12		if(location.search.slice(-12) != 'a30800000000') {
13			if($(window).scrollTop() > 0){
14				$("#header").addClass("active");
15			}else{
16				$("#header").removeClass("active");
17			}
18		}
19	});
20
21	/*$("#trip_area").find("ul").addClass("trip_list").addClass("clearfix");*/
22
23	//상단 메뉴
24	$("#nav .depth1 > li").on("mouseenter focusin", function(){
25		var navHeight = $(this).children(".depth2box").outerHeight();
26		$(this).addClass("active");
27		$("#header").addClass("active");
28		if($(this).find(".depth2").length > 0){
29			$(".menu_bg").css({
30				"height": navHeight, "display":"block"
31			});
32			$(".menu_bg").removeClass().addClass("menu_bg").addClass($(this).attr('id'));
33			$(".mask").show();
34			$(this).siblings().children(".depth2box").removeClass("active");
35			$(this).siblings().removeClass("active");
36			$(this).children(".depth2box").addClass("active");
37		}
38	});
39	$("#nav .depth1 > li").on("mouseleave", function(){
40		$(this).removeClass("active");
41		$("#header").removeClass("active");
42		$(".menu_bg").css({
43			"height":"", "display":"none"
44		});
45		$(".menu_bg").removeClass($(this).attr('id'));
46		if(!$('.find_top_area').hasClass("on")) {
47			$(".mask").hide();
48		}
49		$("#nav .depth1 > li > .depth2box").removeClass("active");
50	});
51	$(document).on("focusin", function(){
52		if($(":focus").parents("#nav").length <= 0 && $("#nav .depth1 > li.active").length > 0){
53			$("#nav .depth1 > li").removeClass("active");
54			$("#nav .depth2box").removeClass("active");
55			$(".menu_bg").css({
56				"height":"", "display":"none"
57			});
58			$(".menu_bg").removeClass().addClass("menu_bg");
59			$(".mask").hide();
60		}
61	})
62
63	// 전체메뉴이자 모바일 메뉴
64    //$("#gnb2").gnb2();
65	set_gnb2($("#gnb2"));
66
67
68	//모바일 사이드 메뉴
69	$(".slider_btn").click(function(){
70		var snbWidth = $("#sidebar #snb").outerWidth();
71
72		if(!$("#sidebar").hasClass("slidefull")){
73		  $("#sidebar").fadeIn();
74		  $("#sidebar").addClass("slidefull");
75		  $("#sidebar #snb").animate({right: "0"},200);
76		}else{
77		  $("#sidebar").fadeOut();
78		  $("#sidebar").removeClass("slidefull");
79		  $("#sidebar #snb").animate({right: "-"+snbWidth},200);
80		}
81	});
82
83
84
85	//서브 메뉴
86	$(".lnb_list .depth1 > li > a").click(function(){
87	  if($(this).parent("li").children("ul").length > 0){
88		if($(this).parent("li").hasClass("active")){
89		  $(".lnb_list .depth1 > li").removeClass("active");
90		}else{
91		  $(".lnb_list .depth1 > li").removeClass("active");
92		  $(this).parent("li").addClass("active");
93		}
94	  }
95	});
96
97
98
99	//하단 관련 사이트
100	$(".family_site .depth1 > li > button").on("click", function(){
101	  if(!$(this).parent("li").hasClass("active")){
102		  $(this).parent("li").addClass("active").siblings("li").removeClass("active");
103	  }else{
104
105	  }
106	});
107
108	$(window).mouseup(function (e){
109		if($("#footer .family_site").has(e.target).length === 0){
110			$("#footer .family_site .depth1 > li").removeClass("active");
111		}
112    });
113
114/*	$("#trip_area .trip_lnb > li > a").on("focusin", function(){
115		$("#trip_area .depth2").removeClass("active");
116		$(this).next(".depth2").addClass("active");
117	})
118	$("#trip_area .depth2  a").on("focusin", function(){
119		$("#trip_area .depth2").removeClass("active");
120		$(this).parents(".depth2").addClass("active");
121	})
122	$("#trip_area").next().find("a:eq(0)").on("focusin", function(){
123		$("#trip_area .depth2").removeClass("active");
124	})*/
125
126	$("#trip_area .trip_lnb > li a").click(function(){
127		$(this).parents("li").siblings().find(".depth2").hide();
128		if($(this).next(".depth2").is(":visible")){
129			$(this).next(".depth2").hide();
130		}else{
131			$(this).next(".depth2").show();
132		}
133
134	})
135	$("#trip_area .trip_lnb > li:eq(0)").children("a").attr("title", "메인으로 이동");
136	$("#trip_area .trip_lnb > li").not(":eq(0)").children("a").attr("title", "메뉴선택");
137
138
139	$("#trip_area .trip_lnb > li").on("mouseenter focusin", function() {
140	  const $trigger = $(this).children("a");
141	  $trigger.attr("aria-expanded", "false");
142	});
143
144	$("#trip_area .trip_lnb > li").on("mouseleave", function() {
145	  const $trigger = $(this).children("a");
146	  $trigger.attr("aria-expanded", "true");
147	});
148});
149
150/*-------------------------------------------------
151title       : 메뉴2
152-------------------------------------------------*/
153$.fn.gnb2 = function( options )
154{
155	 var settings = $.extend
156	    ({
157	        'btnOpen'           : '.open',      // 최초 메뉴를 여는 버튼
158	        'btnClose'          : '.close',     // 닫기 버튼이 별도로 존재하는 경우
159	        'classAdd'          : '#gnb2',      // 활성화 시 클래스가 추가되는 요소
160	        'classAdd2'         : '#gnb2 .mnfirst',      // 2차 메뉴 초기 활성화되는 클래스명
161	        'className'         : 'active',     // 추가할 클래스명 (classAdd에 추가됨)
162	        'siblings'			: true,		    // active 될 때 형제요소의 반응 여부
163	        'responsive'        : false,         // 반응형일 때 (true 시 반응형일때 가로 사이즈 이하에서만 / false 시 반응형 아닐 때도 클릭 동작함)
164	        'responsiveWidth'   : '1024',        // 반응형 가로 사이즈
165	        'target'            : '#wrap',                // 활성화 시 클래스가 추가되는 요소 (공란일 경우 오버되는 a 링크 부모 li에만 í
165´ëž˜ìФ 추가됨)
166	        'class'             : 'sitemap',                 // 추가할 클래스명 (target에 추가됨)
167
168	    },
169	    options );
170
171	// gnb2 3차 메뉴 가지고 있는 li에 클래스 추가
172    $('#gnb2 .depth2box > ul > li').each(function(i)
173    {
174        if ( $(this).find('div').length > 0 )
175        {
176           // $(this).addClass('type1');
177        }
178    });
179
180    // 모바일 메뉴에서 3뎁스 있을 때
181	$('#gnb2 .depth2box > ul > li.type1 > a').on('click', function(){
182		if($(this).parent().hasClass('active')){
183			$(this).parent().removeClass('active');
184		}else{
185			$(this).parent().addClass('active').siblings().removeClass('active');
186		}
187		return false;
188	});
189
190	 return this.each(function()
191    {
192        var $selecter = $(this);
193
194
195        // 메뉴 클릭 이벤트
196        function menuAction($this)
197        {
198
199        	if($this.parent('li').hasClass("sub01") && $this.parent('li').parents('li').hasClass("lnb1")){
200
201        	}else  if ( $this.next('*').length > 0)
202            {
203
204                $this.parent('li').siblings('li').removeClass('active');
205                $this.parent('li').addClass('active');
206
207                event.preventDefault();
208            }
209        }
210
211        // 메뉴
212        $selecter.find('li a').on('click', function(e)
213        {
214
215            if ( settings.responsive == true )
216            {
217                if ( $(window).width() <= settings.responsiveWidth )
218                {
219                    menuAction($(this));
220                }
221            }
222            else
223            {
224                menuAction($(this));
225            }
226        });
227
228		return false;
229    });
230};
231
232function getParam(strHref, strParamName){
233	var strReturn = "";
234	var bFound=false;
235	var cmpstring = strParamName + "=";
236	var cmplen = cmpstring.length;
237	if ( strHref.indexOf("?") > -1 ){
238		var strQueryString = strHref.substr(strHref.indexOf("?")+1);
239		var aQueryString = strQueryString.split("&");
240		for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
241			if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
242				var aParam = aQueryString[iParam].split("=");
243				strReturn = aParam[1];
244				bFound=true;
245				break;
246			}
247		}
248	}
249	if (bFound==false) return null;
250	return strReturn;
251}
252
253function showSearch() {
254	if($('.find_top_area').hasClass("on")) {
255		$('.find_top_area').removeClass("on");
256		$(".mask").hide();
257	} else {
258		$('.find_top_area').addClass("on");
259		$(".mask").show();
260		$("#search").focus(); //웹접근성위해추가. 팝업닫았을때 버튼으로 포커스 돌아오기
261	}
262}
263
264function closeSearch(){
265	$('.find_top_area').removeClass("on");
266	$(".mask").hide();
267	$("#hd_btn_find").focus(); //웹접근성위해추가. 팝업닫았을때 버튼으로 포커스 돌아오기
268}
269
270function drop_language () {
271
272	if($(".drop_language").hasClass("active")) {
273		$(".drop_language").removeClass("active");
274	} else {
275		$(".drop_language").addClass("active");
276	}
277
278}
279
280function set_gnb2($this){
281	var settings = {
282	        'btnOpen'           : '.open',      // 최초 메뉴를 여는 버튼
283	        'btnClose'          : '.close',     // 닫기 버튼이 별도로 존재하는 경우
284	        'classAdd'          : '#gnb2',      // 활성화 시 클래스가 추가되는 요소
285	        'classAdd2'         : '#gnb2 .mnfirst',      // 2차 메뉴 초기 활성화되는 클래스명
286	        'className'         : 'active',     // 추가할 클래스명 (classAdd에 추가됨)
287	        'siblings'			: true,		    // active 될 때 형제요소의 반응 여부
288	        'responsive'        : false,         // 반응형일 때 (true 시 반응형일때 가로 사이즈 이하에서만 / false 시 반응형 아닐 때도 클릭 동작함)
289	        'responsiveWidth'   : '1024',        // 반응형 가로 사이즈
290	        'target'            : '#wrap',                // 활성화 시 클래스가 추가되는 요소 (공란일 경우 오버되는 a 링크 부모 li에만 í
290´ëž˜ìФ 추가됨)
291	        'class'             : 'sitemap',                 // 추가할 클래스명 (target에 추가됨)
292
293	    };
294
295	// gnb2 3차 메뉴 가지고 있는 li에 클래스 추가
296	$('#gnb2 .depth2box > ul > li').each(function(i)
297	{
298	    if ( $this.find('div').length > 0 )
299	    {
300	       // $this.addClass('type1');
301	    }
302	});
303
304	// 모바일 메뉴에서 3뎁스 있을 때
305	$('#gnb2 .depth2box > ul > li.type1 > a').on('click', function(){
306		if($this.parent().hasClass('active')){
307			$this.parent().removeClass('active');
308		}else{
309			$this.parent().addClass('active').siblings().removeClass('active');
310		}
311		return false;
312	});
313
314	$this.each(function(i, item)
315	{
316	    var $selecter = $(item);
317
318
319	    // 메뉴 클릭 이벤트
320	    function menuAction($item)
321	    {
322
323	    	if($item.parent('li').hasClass("sub01") && $item.parent('li').parents('li').hasClass("lnb1")){
324
325	    	}else  if ( $item.next('*').length > 0)
326	        {
327
328	    		$item.parent('li').siblings('li').removeClass('active');
329	    		$item.parent('li').addClass('active');
330
331	            event.preventDefault();
332	        }
333	    }
334
335	    // 메뉴
336	    $selecter.find('li a').on('click', function(e)
337	    {
338
339	        if ( settings.responsive == true )
340	        {
341	            if ( $(window).width() <= settings.responsiveWidth )
342	            {
343	                menuAction($(this));
344	            }
345	        }
346	        else
347	        {
348	            menuAction($(this));
349	        }
350	    });
351
352		return false;
353	});
354}
355

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.