PageSourceSearch

https://www.gwanak.go.kr/js/gwanak/sub.js?v=2026092503

js gwanak.go.kr collected 2026-09-24 18:35:55 UTC 8,226 bytes, 377 lines download raw bytes

1
2	function getQrCode(snsUrl, snsTitle) {
3		
4		$.post (
5			"/site/sd/ajax/getQrCode.jsp",
6			$("#qrFrm").serialize(),
7			function(data, type) {
8				if(data.result == "true") {
9					$("#qr").html("<a href=\"/upload/qrcode/"+data.fileName+".png\" title=\"새창열기\" target=\"_blank\"><img src=\"/upload/qrcode/"+data.fileName+".png\" alt=\"QR코드\"/></a>");
10				}else{
11					alert(data.message);
12				}
13			}
14		, "json");
15	}
16
17	function printContent(code) {
18		window.open('/common/print/print_new.jsp?code='+code,'printWindow', 'location=no, directories=no, resizable=yes, status=no, toolbar=no, menubar=no, scrollbars=no, width=660, height=600');
19	}
20	
21	function goGnb() {
22		var link = location.href;
23		location.href=link+"#gnb";
24		$("#gnb").find("a:first").focus();
25	}
26	function goAside() {
27		var link = location.href;
28		location.href=link+"#aside";
29		$("#aside").find("a:first").focus();
30	}
31	function goContents() {
32		var link = location.href;
33		location.href=link+"#contents";
34		$("#contents").find("a:first").focus();
35	}
36	function goFooter() {
37		var link = location.href;
38		location.href=link+"#footer";
39		$("#footer").find("a:first").focus();
40	}
41
42	/* 재정공시 */
43	function doGraphView(){
44		var id = document.getElementById("year").value;
45		
46		for(var i=1;i<9;i++){
47			$("#gongsi"+i).css("display","none");
48		}
49		$("#gongsi"+id).css("display","block");
50	}
51
52
53
54/*강감찬 마스코트 소개 19.08 추가*/
55$(function(){
56	initSimpleBanner();
57});
58
59
60function initSimpleBanner(){
61	var wrap;
62	var W;
63	var H;
64	var lis;
65	var li;
66	var nav_wrap;
67	var nav_ul;
68	var nav_ul;
69	var cnt;
70	var i;
71	var itv;
72	var type;
73	var nav_type;
74	$(".mascot_img").each(function(idx){
75		// init variables
76		wrap = $(this);
77		wrap.data("index", idx);
78		wrap.data("current", 0);
79		wrap.data("mouseenter", false);
80		W = wrap.width();
81		H = wrap.height();
82		switch(wrap.data("type")){
83			case "hslide":
84			case "vslide":
85			case "alpha":
86				type = wrap.data("type");
87			break;
88			
89			default:
90				wrap.data("type", "alpha");
91				type = "alpha";
92			break;
93		}
94		switch(wrap.data("nav-type")){
95			case "numeral":
96			case "bullet":
97			case "prev_next":
98				nav_type = wrap.data("nav-type");
99			break;
100			
101			default:
102				wrap.data("nav-type", "bullet");
103				nav_type = "bullet";
104			break;
105		}
106		if(isNaN(wrap.data("interval"))){
107			wrap.data("interval", 5000);
108		}
109		lis = wrap.find("ul li");
110		cnt = lis.length;
111		wrap.data("total", cnt);
112		
113		// init banners
114		if(type == "hslide"){
115			lis.each(function(idx, itm){
116				li = $(itm);
117				li.css("left", W * idx + "px");
118			});
119		}else if(type == "vslide"){
120			lis.each(function(idx, itm){
121				li = $(itm);
122				li.css("top", H * idx + "px");
123			});
124		}else{
125			lis.each(function(idx, itm){
126				li = $(itm);
127				if(idx == 0){
128					li.css({zIndex:1, opacity:1});
129				}else{
130					li.css("opacity", 0);
131				}
132			});
133		}
134		
135		// init navigation
136		wrap.append('<div class="nav_wrap ' + nav_type + '"><ul></ul></div>');
137		nav_wrap = wrap.find(".nav_wrap");
138		nav_ul = wrap.find(".nav_wrap ul");
139		switch(nav_type){
140			case "numeral":
141			case "bullet":
142				for(i=0; i<cnt; i++){
143					nav_ul.append('<li>'+(i+1)+'</li>');
144				}
145				nav_ul.find("li").bind("click", sbNavClickListener);
146				nav_ul.find("li").eq(0).addClass("on");
147			break;
148			
149			case "prev_next":
150				nav_ul.append('<li>&lt;</li>');
151				nav_ul.append('<li>&gt;</li>');
152				nav_ul.find("li").bind("click", sbNavClickListener);
153			break;
154		}
155		
156		
157		
158		// rest timer
159		i = idx;
160		itv = wrap.data("interval");
161		setTimeout("sbAnimateBannerTimer("+i+")", itv);
162		
163		// init events
164		wrap.bind("mouseenter", sbMouseEnterListener);
165		wrap.bind("mouseleave", sbMouseLeaveListener);
166	});
167}
168
169/**
170 * mouse enter listener
171 * kill timer on mouse enter
172 */
173function sbMouseEnterListener(e){
174	var wrap = $(e.currentTarget);
175	wrap.data("mouseenter", true);
176	if(wrap.data("stid")){
177		clearTimeout(wrap.data("stid"));
178	}
179}
180/**
181 * mouse leave listener
182 * reset timer on mouse leave
183 */
184function sbMouseLeaveListener(e){
185	var wrap = $(e.currentTarget);
186	wrap.data("mouseenter", false);
187	var n = wrap.data("index");
188	var itv = wrap.data("interval");
189	wrap.data("stid", setTimeout("sbAnimateBannerTimer("+n+")", itv));
190}
191
192/**
193 * timer callback function
194 */
195function sbAnimateBannerTimer(idx){
196	var wrap = $(".mascot_img").eq(idx);
197	//console.log("timeout", idx, wrap.data("current"), wrap.data("total"), wrap.data("stid"));
198	
199	var c = wrap.data("current") + 1;
200	if(c >= wrap.data("total")){
201		c = 0;
202	}
203	sbAnimateBanner(wrap, c);
204}
205
206/**
207 * navigation click listener
208 */
209function sbNavClickListener(e){
210	var n;
211	var nav = $(e.target);
212	var wrap = nav.parents(".mascot_img");
213	switch(wrap.data("nav-type")){
214		case "numeral":
215		case "bullet":
216			n = nav.html() - 1;
217		break;
218		
219		case "prev_next":
220			var total = wrap.data("total");
221			n = wrap.data("current");
222			if(nav.html() == "&lt;"){
223				n--;
224				if(n < 0){
225					n = total - 1;
226				}
227			}else{
228				n++;
229				if(n >= total){
230					n = 0;
231				}
232			}
233		break;
234	}
235	
236	sbAnimateBanner(wrap, n);
237}
238
239/**
240 * animates banners
241 */
242function sbAnimateBanner(wrap, cur){
243	// kill timer
244	if(wrap.data("stid")){
245		clearTimeout(wrap.data("stid"));
246	}
247	
248	// init variables
249	wrap.data("current", cur);
250	var type = wrap.data("type");
251	var W = wrap.width();
252	var H = wrap.height();
253	var wrap_ul = wrap.children("ul");
254	var wrap_lis = wrap_ul.children();
255	var nav_li;
256	
257	// animate banner
258	if(type == "hslide"){
259		wrap_ul.stop(true);
260		wrap_ul.animate({left:-W*cur+"px"}, 200);
261	}else if(type == "vslide"){
262		wrap_ul.stop(true);
263		wrap_ul.animate({top:-H*cur+"px"}, 200);
264	}else{
265		var li;
266		wrap_lis.each(function(idx, itm){
267			li = $(itm);
268			li.stop(true);
269			if(idx == cur){
270				li.css("z-index", 1);
271				li.animate({opacity:1}, 200);
272			}else{
273				li.css("z-index", 0);
274				li.animate({opacity:0}
274, 200);
275			}
276		});
277	}
278	
279	// update navigation
280	switch(wrap.data("nav-type")){
281		case "numeral":
282		case "bullet":
283			wrap.find(".nav_wrap ul li").each(function(idx, itm){
284				nav_li = $(itm);
285				if(idx == cur){
286					nav_li.addClass("on");
287				}else{
288					nav_li.removeClass("on");
289				}
290			});
291		break;
292		
293		//case "prev_next":
294			// do nothing
295		//break;
296	}
297	
298	// reset timer
299	if(wrap.data("mouseenter") == false){
300		var n = wrap.data("index");
301		var itv = wrap.data("interval");
302		wrap.data("stid", setTimeout("sbAnimateBannerTimer("+n+")", itv));
303	}
304}
305
306// 관악산탐방 swiper
307$(function(){
308	const rockSwiper = new Swiper(".rock-list-wrap", {
309		slidesPerView: 3,
310		loop: true,
311		loopAdditionalSlides: 1,
312		autoplay: true,
313		autoplaySpeed : 500,
314		touchMove : false,
315		spaceBetween: 30,
316		breakpoints:{
317			1000:{
318				slidesPerView: 2,
319				spaceBetween: 20,
320			},
321			600:{
322				slidesPerView: 1,
323				spaceBetween: 0,
324			},
325		},
326		navigation: {
327			prevEl: ".rock-prev",
328			nextEl: ".rock-next",
329		},
330	});
331	var sw = 0;
332	$('.rock-pause').click(function(){
333		if(sw==0){
334			$('.rock-pause').addClass('on').text('재생');
335			rockSwiper.autoplay.stop();
336			sw = 1;
337		}else{
338			$('.rock-pause').removeClass('on').text('일시정지');
339			rockSwiper.autoplay.start();
340			sw = 0;
341		}
342	});
343});
344// 탐방로
345$(function(){
346	$('.hiking-pagenaition a').click(function(e){
347		e.preventDefault();
348		var idx = $(this).index();
349		$('.hiking-pagenaition a').removeClass('on');
350		$(this).addClass('on');
351		$('.hiking-list-box').removeClass('on');
352		$('.hiking-list-box').eq(idx).addClass('on');
353	});
354});
355// 안전수칙
356$(function(){	
357	$(".safe-rules > dd.open").show();
358	
359	$(".safe-rules > dt > a").on("click",function(e){
360		e.preventDefault();
361
362		var $this = $(this);
363		var $safe = $(this).parent().next("dd");
364
365		$safe.stop().slideToggle(500);
366
367		$safe.toggleClass("open");
368		$this.toggleClass("open");
369		
370		if($safe.hasClass("open")){
371			$(this).attr("title", "상세보기 레이어 닫기")
372		}else{
373			$(this).attr("title", "상세보기 레이어 열기")
374		}
375			
376	});
377});

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.