PageSourceSearch

https://www.cak.or.kr/lib/js/common.js

js cak.or.kr collected 2026-10-06 01:07:32 UTC 13,625 bytes, 438 lines download raw bytes

1
2//tab menu
3//var LnBsite = $('#lnb').html();
4//$('#lnb_site_map').html(LnBsite);
5
6	$('header .head_cont .head_right .inner_box .all_menu.pc').on('click', function (){
7		if($('header').hasClass('portal')){
8			$('body').attr('style','overflow: hidden; padding: 0 0px 0 0;');
9		}else{
10			$('body').attr('style','overflow: hidden; padding: 0 17px 0 0;');
11		}
12		$('header .sitemap_wrap').attr('style', 'overflow: auto;');
13		$('header .sitemap_wrap').stop().fadeIn(500,function(){
14		});
15		var LnBsite = $('#lnb_site_map').html();
16		$('header .sitemap_wrap .sitemap_menu_list_cont .container2 .sitemap_menu_list_area').html(LnBsite);
17		$('header .sitemap_wrap .sitemap_menu_list_cont .container2 .sitemap_menu_list_area > .list > li > div:nth-child(2)').remove();
18
19		$('.sitemap_menu_list_area > .list > li > .lnb_sub > ul > li > ul > li').each(function (){
20			if($(this).find('> a').attr('target') == '_blank'){
21				$(this).find('> a').attr('title', '새창 열림');
22				$(this).find('> a').addClass('new_link');
23			}
24		});
25		$('body').on('scroll touchmove mousewheel', function(e) {
26			e.preventDefault();
27			e.stopPropagation();
28			return false;
29		});
30
31	});
32
33	$('header .sitemap_wrap .sitemap_title_area .inner_box .box a').on('click', function (){
34		$('.open_bg').hide();
35		$('header .sitemap_wrap').attr('style', 'overflow: hidden;');
36		$('header .sitemap_wrap').stop().fadeOut(300);
37		$('body').attr('style','overflow: visible; padding: 0;');
38		$('body').off('scroll touchmove mousewheel');
39		$('header').removeClass('open');
40		$('.head_left #lnb > .list > li').removeClass('open');
41	});
42
43	$('#fullpage').on('click', function (){
44		$('.open_bg').hide();
45		$('header').removeClass('open');
46		$('.head_left #lnb > .list > li').removeClass('open');
47
48	});
49
50	$('#sub').on('click', function (){
51		$('.open_bg').hide();
52		$('header').removeClass('open');
53		$('body').css('overflow', '');
54		$('body').css('overflow-y', 'visible');
55		$('.head_left #lnb > .list > li').removeClass('open');
56		$('body').off('scroll touchmove mousewheel');
57
58	});
59
60	$('.open_bg').on('click', function (){
61		$(this).hide();
62		$('header').removeClass('open');
63		$('body').css('overflow', '');
64		$('body').css('padding', '0');
65		$('.head_left #lnb > .list > li').removeClass('open');
66		$('body').off('scroll touchmove mousewheel');
67	});
68
69
70
71
72function shwoTabNav(eName, totalNum, showNum) {
73	for (i = 1; i <= totalNum; i++) {
74		var zero = (i >= 10) ? "" : "0";
75		var e = document.getElementById("tabNav" + eName + zero + i);
76		var eTitle = document.getElementById("tabNavTitle" + eName + zero + i);
77		e.style.display = "none";
78		eTitle.className = "";
79	}
80
81	var zero = (showNum >= 10) ? "" : "0";
82	var e = document.getElementById("tabNav" + eName + zero + showNum);
83	var eTitle = document.getElementById("tabNavTitle" + eName + zero + showNum);
84	e.style.display = "block";
85	eTitle.className = "on";
86}
87
88$(document).ready(function(){
89	if($('div').hasClass('board_view2')){
90		$('.sub_contents').addClass('viewconts');
91	}
92	
93	
94
95	$('body').addClass('new');
96
97	$header = $("#header");
98	// img on_off
99	var imgBtn = $('a.btn');
100
101	if($('a').hasClass('btn')){
102
103		// 콘솔오류 수정
104		imgBtn.on('mouseenter', function(){
105			var src = $(this).find('img').attr('src');
106			if(src != undefined){
107				$(this).find('img').attr('src', src.replace('_off', '_on'));
108			}
109
110		});
111
112		imgBtn.on('mouseleave', function(){
113			var src = $(this).find('img').attr('src');
114			if(src != undefined){
115				$(this).find('img').attr('src', src.replace('_on', '_off'));
116			}
117		});
118	}
119
120	// mobile search
121
122	$('.search_m').on('click', function(){
123		$('#header').toggleClass('m_header_on');
124		$('.h_search').slideToggle(0);
125	});
126
127
128	// 스크롤 시
129	$(window).scroll(function(){
130		var pageY = window.pageYOffset;
131
132		if(pageY > 0){
133			$header.addClass("wheel");
134		}
135		else{
136			$header.removeClass("wheel");
137		}
138	});
139	$(window).scroll();
140
141
142//	$('.menu_bot_cont .data_menu_list_area > .list > li > a').attr('href', 'javascript:void(0);');
143	$('.menu_bot_cont .data_menu_list_area > .list > li:not(.link) > a').attr('href', 'javascript:void(0);');
144
145	/*$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li .lnb_sub > ul > li > ul').prev('a').addClass('arr');
146	$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li .lnb_sub > ul > li > ul').prev('a').attr('href', 'javascript:void(0);');
147	$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li .lnb_sub > ul > li > ul').prev('a').removeAttr('target');*/
148
149	
150	$('.m_menu_wrap > .menu_cont > .menu_bot_cont > .data_menu_list_area > .list > li').not('.link').find('> a').attr('href', 'javascript:void(0);');
151
152	
153	
154	$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li .lnb_sub > ul > li').each(function() {
155		if ($(this).children('ul').children("li").length > 0) { //하위메뉴 있는지 체크
156			$(this).children('a').addClass('arr');
157			$(this).children('a').attr('href', 'javascript:void(0);');
158			$(this).children('a').removeAttr('target');
159		}
160	});
161
162	$('.menu_bot_cont .data_menu_list_area > .list > li div:nth-child(2)').remove();
163	$('.menu_bot_cont .data_menu_list_area > .list > li .lnb_sub > ul > li > ul > li > ul').remove();
164
165	$('header .container .head_cont .head_right .inner_box .box .btn.m').on('click', function (){
166		localStorage.clear();
167		$('.m_menu_wrap').show().animate({"right": 0}, 300);
168		$("body").css({"overflow-y":"hidden"});
169	});
170
171	$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li > a').on('click', function (){
172		$(this).closest('li').toggleClass('on');
173		$(this).closest('li').siblings('li').removeClass('on');
174		$(this).closest('li').siblings('li').find('.lnb_sub > ul > li').removeClass('on');
175
176		if($(this).closest('li').hasClass('on')){
177			$(this).siblings('.lnb_sub').slideDown(300);
178			$(this).closest('li').siblings('li').find('.lnb_sub').slideUp(300);
179			$(this).closest('li').siblings('li').find('.lnb_sub > ul > li > ul').slideUp(300);
180		} else {
181			$(this).siblings('.lnb_sub').slideUp(300);
182		}
183	});
184	$(document).ready(function(){
185		$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li.on').find('.lnb_sub').slideDown(300);
186		$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li.on .lnb_sub > ul > li.on').find('ul').slideDown(300);
187
188	});
189
190	$('.m_menu_wrap .menu_cont .menu_bot_cont .data_menu_list_area > .list > li .lnb_sub > ul > li > a').on('click', function (){
191		$(this).closest('li').toggleClass('on');
192		$(this).closest('li').siblings('li').removeClass('on');
193		if($(this).closest('li').hasClass('on')){
194			$(this).siblings('ul').slideDown(300);
195			$(this).closest('li').siblings('li').find('ul').slideUp(300);
196			if($(this).siblings('ul').find('> li > a').attr('target') == '_blank'){
197				$(this).siblings('ul').find('> li > a').addClass('tar');
198			}
199		} else {
200			$(this).siblings('ul').slideUp(300);
201		}
202
203	});
204
205	$('.m_menu_wrap .m_menu_btn').on('click', function (){
206		$('.m_menu_wrap').show().animate({"right": '-100%'}, 300);
207		$("body").css({"overflow-y":"visible"});
208	});
209
210	$(window).resize(function(){
211		windowW = window.innerWidth;
212		if(windowW<1080){
213
214		}
215		if(windowW>1080){
216			$('.m_menu_wrap').hide();
217		}
218	});
219
220});
221
222
223
224//mobile side menu
225$(function(){
226	// drawer menu show hide
227	var movePs = $("#naviMenu").outerWidth();
228	$("#naviMenu").css('left', -1000).hide();
229
230	function navClose() {
231		$('#naviMenu').removeClass('open').css('top',0).find('>div').addBack().css('height',$(window).height());
232		//$(".headerCom").removeClass("naviOpen");
233		$("html, body").css({'overflow':'auto'});
234		$(window).css({'overflow':'auto'});
235		$(".wrap").css({'height':'auto', 'overflow':'auto'}).stop().animate({"left": 0}, 200);
236		$("#naviMenu").css('top',0).stop().animate({'top':0, "left": -1000}, 200,function(){$(this).hide();});
237		$(".dmm").remove();
238
239		if($('#container').find('div').hasClass('lnbWrap')){
240			//$('.lnbWrap, .prdList').css({'position':'fixed'});
241		} else {
242			//$('#lnb, .prdList').css({'position':'fixed'});
243		}
244	}
245
246	function navOpen() {
247		$('#naviMenu').css('top',0).find('>div').addBack().css('height',$(window).height());
248		//$(".headerCom").addClass("naviOpen");
249		$("html, body").css({'overflow':'hidden'});
250		$(window).css({'overflow':'hidden'});
251		$("body").append('<div class="dmm"></div>');
252		$(".wrap").css({'height':$(window).height(), 'overflow':'hidden'}).stop().animate({"left": movePs}, 200);
253		$("#naviMenu").addClass('open').css('top',0).show().stop().animate({'top':0, "left": 0}, 200);
254
255		if($('#container').find('div').hasClass('lnbWrap')){
256			//$('.lnbWrap, .prdList').css({'position':'fixed'});
257		} else {
258			//$('#lnb, .prdList').css({'position':'absolute'});
259		}
260		$('.dmm').click(function(){
261			navClose();
262		});
263
264		setTimeout( gnbPostionSet, 200 );
265	}
266
267	function gnbPostionSet()
268	{
269		var arrTop = [56,133,210,287,364,441];
270		var arrTopPos = [0,-75,-150,-225,-300,-375];
271
272		$(".gnb").each( function ( i ) {
273			var t = arrTop[i];
274			$(this).css("top", t );
275			$(this).find("a").css("background-position", "0px " + arrTopPos[i] + "px");
276		});
277	}
278
279	$(window).resize(function(){
280		if($('#naviMenu').hasClass('open')){
281			$('#naviMenu').css({'top':0, 'left':0}).find('>div').addBack().css('height',$(window).height());
282		} else {
283			$('#naviMenu').css({'top':0, 'left':-1000}).find('>div').addBack().css('height',$(window).height());
284		}
285	});
286
287
288	$(".btnCtg").click(function() {
289		navOpen();
290	});
291	$("#naviMenu .close").click(function() {
292		navClose();
293	});
294
295
296	// drawer menu click
297
298	$(".menuCtg .gnb").click(function(){
299		$("li").has($(this)).siblings("li").removeClass("on");
300		$("li").has($(this)).addClass("on");
301	});
302
303	$(".menuCtg span.arrow").click(function(){
304		$(this).parent().parent().siblings("li").removeClass("on");
305		if ($(this).parent().find("ul").css('display') == 'block') {
306			$(this).parent().removeClass("on");
307		}else {
308			$(this).parent().parent().addClass("on");
309		}
310	});
311
312	$(".menuCtg .subTit").click(function(){
313		$(this).parent().siblings("li").removeClass("on");
314		if ($(this).parent().find(".sub").css('display') == 'block') {
315			$(this).parent().removeClass("on");
316		}else {
317			$(this).parent().addClass("on");
318		}
319	});
320
321	$(".menuCtg .subTit").each(function() {
322		if ($(this).parent().find(".sub").length < 1) {
323			$(this).parent().addClass("subNo");
324		}
325	});
326
327	$(".sideMn").addClass("mn1");
328	$(".menuCtg .gnb").bind("click", function (e) {
329		var i = $("li").has($(this)).index();
330		$(".sideMn").attr('class', 'sideMn');
331		$(".sideMn").addClass("mn" + i);
332	});
333	
334	//LANGUAGE
335	$('.btn_family').click(function () {
336		$(this).toggleClass('open');
337		$('.familyList').toggleClass('open').slideToggle(300);
338	});
339
340	$('.familyList a').click(function () {
341		$(".btn_family").text($(this).text());
342
343		$(this).toggleClass('open');
344		$('.familyList').toggleClass('open').slideToggle(300);
345	});
346
347	//관련사이트
348	$('.btn_family2').click(function () {
349		$(this).toggleClass('open');
350		$('.familyList2').toggleClass('open').slideToggle(300);
351	});
352
353	$('.familyList2 a').click(function () {
354		$(".btn_family2").text($(this).text());
355
356		$(this).toggleClass('open');
357		$('.familyList2').toggleClass('open').slideToggle(300);
358	});
359
360	$('footer .site_list_area .btn').on('click', function (){
361		$(this).next('.site_list').slideToggle(300);
362	});
363
364	$('footer .site_list').mouseleave(function (){
365		$(this).slideUp(300);
366	});
367
368	//검색
369	$("a.sch_btn").click(function(){
370		$(".sch_form").css("display","block");
371		$("a.sch_btn").css("display","none");
372		$("a.close_btn").css("display","block");
373	});
374	$("a.close_btn").click(function(){
375		$(".sch_form").css("display","none");
376		$("a.sch_btn").css("display","block");
377		$("a.close_btn").css("display","none");
378	});
379
380	var scroll = $(window).scrollTop();
381
382	$(window).scroll(function() {
383		if ($(this).scrollTop() > 200) {
384			$('footer .top_btn').fadeIn(300);
385		} else {
386			$('footer .top_btn').fadeOut(300);
387		}
388		scroll = $(window).scrollTop();
389		if (scroll >= 1) {
390
391		} else {
392		}
393	});
394
395	$("footer .top_btn").click(function() {
396		$('html, body').animate({
397			scrollTop : 0
398		}, 400);
399		return false;
400	});
401
402	$('.login_pop_btn').on('click', function (){
403		if($(this).text().trim() == 'ADMIN') {
404			$("#saupjano").attr('placeholder', 'ID를 입력해주세요.');
405			
406    		let firstLiAnchor = $('.menu_list_area ul.list > li:first a');
407
408		    // my_btn 클래스가 있는지 확인
409		    if (firstLiAnchor.hasClass('my_btn')) {
410		        alert('이미 로그인 되어있습니다.');
411		    } else {
412		    	$('.sub_popup_wrap.login_popup').show();    	
413		    }
414    	} else {
415    		$("#saupjano").attr('placeholder', '사업자번호를 입력해주세요.');
416    		$('.sub_popup_wrap.login_popup').show();
417    	}
418    	$("body").css({"overflow-y":"visible"});
419	});
420
421	$('.pass_popup_btn').on('click', function (){
422		$('.sub_popup_wrap.passd_popup').show();
423	});
424
425	$('.etc_popup_btn').on('click', function (){
426		$('.sub_popup_wrap.etc_popup').show();
427	});
428
429	$('.sub_popup_wrap .title_area .pop_close').on('click', function (){
430		$(this).closest('.sub_popup_wrap').fadeOut(300);
431	});
432
433	$('.sub_popup_wrap .popup_btn_area .btn.close').on('click', function (){
434		$(this).closest('.sub_popup_wrap').fadeOut(300);
435	});
436
437	
438});

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.