PageSourceSearch

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

js gwangyang.go.kr collected 2026-10-02 07:32:21 UTC 6,796 bytes, 235 lines download raw bytes

1$(function(){
2
3
4	//상단 메뉴
5	$(window).on("scroll", function(){
6	  if($(window).scrollTop() > 0){
7		$("#header").addClass("active_scroll");
8	  }else{
9		$("#header").removeClass("active_scroll");
10	  }
11	});
12
13	$("#nav .topmenu > li > a").on("mouseenter focusin", function(){
14		var navHeight = $(this).parent("li").children(".submenu").outerHeight();
15		$("#header").addClass("active");
16		$(this).parent("li").addClass("active");
17		$(this).parent("li").children(".submenu").addClass("active");
18	});
19	$("#nav .topmenu > li").on("mouseleave focusout", function(){
20		$("#header").removeClass("active");
21		$(this).removeClass("active");
22		$("#nav .topmenu > li > .submenu").removeClass("active");
23	});
24
25
26
27	//모바일 사이드 메뉴
28	$(".slider_btn").click(function(){
29		var snbWidth = $("#sidebar #snb").outerWidth();
30
31		if(!$("#sidebar").hasClass("slidefull")){
32		  $("#sidebar").fadeIn();
33		  $("#sidebar").addClass("slidefull");
34		  $("#sidebar #snb").animate({right: "0"},200);
35		}else{
36		  $("#sidebar").fadeOut();
37		  $("#sidebar").removeClass("slidefull");
38		  $("#sidebar #snb").animate({right: "-"+snbWidth},200);
39		}
40	});
41
42	// 전체메뉴이자 모바일 메뉴
43    $('#gnb2').gnb2();
44
45	//서브 메뉴
46	$(".lnb_list .depth1 > li > a").click(function(){
47	  if($(this).parent("li").children("ul").length > 0){
48		if($(this).parent("li").hasClass("active")){
49		  $(".lnb_list .depth1 > li").removeClass("active");
50		}else{
51		  $(".lnb_list .depth1 > li").removeClass("active");
52		  $(this).parent("li").addClass("active");
53		}
54	  }
55	});
56
57	//하단 관련 사이트
58	$(".family_site .depth1 > li > button").on("click", function(){
59	  if(!$(this).parent("li").hasClass("active")){
60		  $(this).parent("li").addClass("active").siblings("li").removeClass("active");
61	  }else{
62		  $(this).parent("li").removeClass("active");
63	  }
64	});
65
66	$(window).mouseup(function (e){
67		if($("#footer .family_site").has(e.target).length === 0){
68			$("#footer .family_site .depth1 > li").removeClass("active");
69		}
70    });
71});
72
73/*-------------------------------------------------
74title       : 메뉴2
75-------------------------------------------------*/
76$.fn.gnb2 = function( options )
77{
78	 var settings = $.extend
79	    ({
80	        'btnOpen'           : '.open',      // 최초 메뉴를 여는 버튼
81	        'btnClose'          : '.close',     // 닫기 버튼이 별도로 존재하는 경우
82	        'classAdd'          : '#gnb2',      // 활성화 시 클래스가 추가되는 요소
83	        'classAdd2'         : '#gnb2 .mnfirst',      // 2차 메뉴 초기 활성화되는 클래스명
84	        'className'         : 'active',     // 추가할 클래스명 (classAdd에 추가됨)
85	        'siblings'			: true,		    // active 될 때 형제요소의 반응 여부
86	        'responsive'        : false,         // 반응형일 때 (true 시 반응형일때 가로 사이즈 이하에서만 / false 시 반응형 아닐 때도 클릭 동작함)
87	        'responsiveWidth'   : '1024',        // 반응형 가로 사이즈
88	        'target'            : '#wrap',                // 활성화 시 클래스가 추가되는 요소 (공란일 경우 오버되는 a 링크 부모 li에만 í
88´ëž˜ìФ 추가됨)
89	        'class'             : 'sitemap',                 // 추가할 클래스명 (target에 추가됨)
90
91	    },
92	    options );
93
94	// gnb2 3차 메뉴 가지고 있는 li에 클래스 추가
95    $('#gnb2 .depth2box > ul > li').each(function(i)
96    {
97        if ( $(this).find('div').length > 0 )
98        {
99            $(this).addClass('type1');
100        }
101    });
102
103    // 모바일 메뉴에서 3뎁스 있을 때
104	$('#gnb2 .depth2box > ul > li.type1 > a').on('click', function(){
105		if($(this).parent().hasClass('active')){
106			$(this).parent().removeClass('active');
107		}else{
108			$(this).parent().addClass('active').siblings().removeClass('active');
109		}
110		return false;
111	});
112
113	 return this.each(function()
114    {
115        var $selecter = $(this);
116
117
118        // 메뉴 클릭 이벤트
119        function menuAction($this)
120        {
121
122        	 if ( $this.next('*').length > 0)
123            {
124
125                $this.parent('li').siblings('li').removeClass('active');
126                $this.parent('li').addClass('active');
127
128                event.preventDefault();
129            }
130        }
131
132        // 메뉴
133        $selecter.find('li a').on('click', function(e)
134        {
135
136            if ( settings.responsive == true )
137            {
138                if ( $(window).width() <= settings.responsiveWidth )
139                {
140                    menuAction($(this));
141                }
142            }
143            else
144            {
145                menuAction($(this));
146            }
147        });
148
149		return false;
150    });
151};
152
153function getParam(strHref, strParamName){
154	var strReturn = "";
155	var bFound=false;
156	var cmpstring = strParamName + "=";
157	var cmplen = cmpstring.length;
158	if ( strHref.indexOf("?") > -1 ){
159		var strQueryString = strHref.substr(strHref.indexOf("?")+1);
160		var aQueryString = strQueryString.split("&");
161		for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
162			if (aQueryString[iParam].substr(0,cmplen)==cmpstring){
163				var aParam = aQueryString[iParam].split("=");
164				strReturn = aParam[1];
165				bFound=true;
166				break;
167			}
168		}
169	}
170	if (bFound==false) return null;
171	return strReturn;
172}
173
174function tabFunc(mid) {
175
176	$('.btn_area li').removeClass('on');
177	$('.prev_btn').removeClass('active');
178	$('.next_btn').removeClass('active');
179	$('#btn_m_prev').data('value', '');
180	$('#btn_m_next').data('value', '');
181
182	for(var i = 1; i < 4; i++) {
183
184		var classStr = 'img0'+i;
185
186		if($('.front_area').hasClass(classStr)) {
187			$('.front_area').removeClass(classStr);
188		}
189
190	}
191
192	for(var i = 1; i < 4; i++) {
193
194		var classStr = 'btn0'+i;
195
196		if($('.' + classStr).data('value') == mid) {
197			$('.' + classStr).parent().addClass('on');
198		}
199
200	}
201
202	var mid = mid;
203
204	switch(mid) {
205	case 'a80301000000' :
206		$('.front_area').addClass('img01');
207
208		$('.next_btn').addClass('active');
209		$('#btn_m_next').data('value', 'a80302000000');
210		break;
211	case 'a80302000000' :
212		$('.front_area').addClass('img02');
213
214		$('.prev_btn').addClass('active');
215		$('.next_btn').addClass('active');
216		$('#btn_m_prev').data('value', 'a80301000000');
217		$('#btn_m_next').data('value', 'a80303000000');
218		break;
219	case 'a80303000000' :
220		$('.front_area').addClass('img03');
221
222		$('.prev_btn').addClass('active');
223		$('#btn_m_prev').data('value', 'a80302000000');
224		break;
225	}
226
227	$('.btn_area.more').attr('href','/art/menu.es?mid=' + mid);
228
229}
230
231function goSiteLink(pthis){
232	if(pthis){
233		window.open(pthis.value);
234	}
235}

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.