PageSourceSearch

https://www.kps.or.kr/include/js/e_sub.js

js kps.or.kr collected 2026-09-24 09:42:25 UTC 4,935 bytes, 186 lines download raw bytes

1$(document).ready(function(e){
2	//subVisual
3	subVisual();
4	//subTab
5	subTab();	
6	//subNavi
7	subNavi();	
8	//trans
9	trans();
10	//selVoca
11	selVoca();
12	//subLeft
13	subLeft();
14	//branchGall
15	branchGall();
16	//fulldown table
17	fulldownTable();
18	//viewGall
19	viewGall();
20	//slideList
21	slideList();
22	//layoutCss
23
24});
25function subVisual(){
26	$('.branch-visual').not('.slick-initialized').slick({
27		arrows: false,
28		dots: false,		
29		slidesToShow: 1,
30		slidesToScroll: 1,
31		fade: true,
32		autoplay: true,
33		autoplayspeed: 2000,
34		speed: 1000,	
35		infinite: true
36	});
37}
38
39function subTab(){
40	$('.sub-tabcon').hide().first().show();
41	$('.sub-tabmenu > li').on('click',function(e){
42		var cnt = $(this).index();
43		$('.sub-tabcon').hide().eq(cnt).show();
44		$('.sub-tabmenu > li').removeClass('on');
45		$(this).addClass('on');
46	});
47}
48
49function subNavi(){
50	var i = 0;
51	var text;
52	var title = text + i;
53	
54	$('.sub-menu-click').off().on('click',function(e){
55		$(this).next('ul').stop().slideToggle();
56		$('.sub-menu-click').not(this).next('ul').stop().slideUp();
57	});
58}
59
60function subLeft(){
61	$('.left-menu > li > a').on('click',function(e){
62		$(this).parent('li').toggleClass('on');
63		$(this).next('.sub-left-menu').stop().slideToggle();
64		$('.left-menu > li > a').not(this).parent('li').removeClass('on');
65		$('.left-menu > li > a').not(this).next('.sub-left-menu').stop().slideUp();
66	});
67	//	3depth
68	$('.sub-left-menu > li > a').on('click',function(e){
69		$(this).parent('li').toggleClass('on');
70		$(this).next('ul').stop().slideToggle();
71		$('.sub-left-menu > li > a').not(this).parent('li').removeClass('on');
72		$('.sub-left-menu > li > a').not(this).next('ul').stop().slideUp();
73	});
74	//	4depth
75	$('.sub-left-menu > li > ul > li > a').on('click',function(e){
76		$(this).parent('li').toggleClass('on');
77		$(this).next('ul').stop().slideToggle();
78		$('.sub-left-menu > li > ul > li > a').not(this).parent('li').removeClass('on');
79		$('.sub-left-menu > li > ul > li > a').not(this).next('ul').stop().slideUp();
80	});	
81	//	5depth
82	$('.sub-left-menu > li > ul > li > ul > li > a').on('click',function(e){
83		$(this).parent('li').toggleClass('on');
84		$(this).next('ul').stop().slideToggle();
85		$('.sub-left-menu > li > ul > li > ul > li > a').not(this).parent('li').removeClass('on');
86		$('.sub-left-menu > li > ul > li > ul > li > a').not(this).next('ul').stop().slideUp();
87	});	
88}
89
90function trans(){
91	var en_tit = $('.en-tit').text();
92	var ko_tit = $('.ko-tit').text();		
93	var en_trans_con = $('.voca-con.en .trans-con textarea').val();
94	var ko_trans_con = $('.voca-con.ko .trans-con textarea').val();
95	
96	$('.voca-wrap .btn-trans').on('click',function(e){
97		if($(this).hasClass('on')){
98			// default
99			$('.en-tit').text(en_tit); 
100			$('.ko-tit').text(ko_tit);
101			$('.voca-con.en .trans-con textarea').val(en_trans_con);
102			$('.voca-con.ko .trans-con textarea').val(ko_trans_con);
103			$(this).removeClass('on');
104		}else{
105			// 번역 버튼 눌렀을 때
106			$('.en-tit').text(ko_tit);
107			$('.ko-tit').text(en_tit);
108			$('.voca-con.en .trans-con textarea').val(ko_trans_con);
109			$('.voca-con.ko .trans-con textarea').val(en_trans_con);
110			$(this).addClass('on');
111		}
112	});
113} 
114
115function selVoca(){
116	$('.sel-list > li').on('click',function(e){
117		$(this).addClass('on');
118		$('.sel-list > li').not(this).removeClass('on');
119	});
120	$('.voca-list .btn-trans').on('click',function(e){
121		if($(this).hasClass('on')){
122			$('.sel-list.en').show();
123			$('.sel-list.ko').hide();
124			$(this).removeClass('on');	
125		}else{
126			$('.sel-list.ko').show();
127			$('.sel-list.en').hide();
128			$(this).addClass('on');	
129		}
130	});
131}
132
133function branchGall(){
134	$('.board-gall-con').not('.slick-initialized').slick({
135		arrows: true,
136		dots: false,
137		autoplay: true,
138		infinite: true,
139		slidesToShow: 3,
140		slidesToScroll: 1,	
141		prevArrow: $('.gall-prev'),
142		nextArrow: $('.gall-next')
143	});
144}
145
146function fulldownTable(){
147	$('.fulldown-table li > a').on('click',function(e){
148		if($(this).hasClass('active')){
149			$(this).addClass('active');
150		}else{
151			$(this).toggleClass('on').children('i').toggleClass('xi-angle-down').toggleClass('xi-angle-up');
152			$(this).next('div').stop().slideToggle();
153			$('.fulldown-table li > a').not(this).removeClass('on').children('i').removeClass('xi-angle-up').addClass('xi-angle-down');
154			$('.fulldown-table li > a').not(this).next('div').stop().slideUp(300);	
155			$(this).removeClass('active');	
156		}
157	});
158}
159
160function viewGall(){
161	$('.gall-prevnext').not('.slick-initialized').slick({
162		arrows: true,
163		dots: false,
164		autoplay: false,
165		infinite: true,
166		slidesToShow: 4,
167		slidesToScroll: 1,
168	});
169}
170
171function slideList(){
172	$('.show-list').on('click',function(e){
173		$(this).parent().next('div').slideToggle();
174	});
175}
176
177
178$(function() {
179	$('ul.tab li').click(function() {
180		var activeTab = $(this).attr('data-tab');
181		$('ul.tab li').removeClass('current');
182		$('.tabcontent').removeClass('current');
183		$(this).addClass('current');
184		$('#' + activeTab).addClass('current');
185	})
186});

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.