PageSourceSearch

https://kist.re.kr/_res/kist/ko/js/cms-common.js

js kist.re.kr collected 2026-10-02 11:31:47 UTC 17,707 bytes, 572 lines download raw bytes

1
2$(document).ready(function () {
3  AOS.init();
4
5  //pc 헤더 뎁스2 오픈
6  $('.nav_list > li').on('mouseenter', function(){
7    if($(window).outerWidth() > 1024){
8      $('.depth02_area').hide();
9      $(this).find('.depth02_area').stop().slideDown();
10    }
11  });
12  $('.nav_list > li').on('mouseleave', function(){
13    if($(window).outerWidth() > 1024){
14      $(this).find('.depth02_area').stop().slideUp();
15      $('.depth03_area').stop().slideUp();
16      $('.depth02').removeClass('on');
17    }
18  });
19
20  //pc 헤더 뎁스3 오픈
21  $('.nav_list .has_depth .depth02').attr('aria-expanded', 'false');
22  $('.depth02_area > ul > li .depth02').on('click', function(e){
23    if($(this).parent('li').hasClass('has_depth')){
24      e.preventDefault();
25      $('.nav_list .has_depth .depth02').attr('aria-expanded', 'false');
26      $(this).attr('aria-expanded', 'true');
27      $('.depth02_area > ul > li .depth02').not($(this)).removeClass('on');
28      $(this).toggleClass('on');
29      $('.depth03_area').not($(this).siblings()).stop().slideUp();
30      $(this).siblings('.depth03_area').stop().slideToggle();
31      if($(this).hasClass('on')){
32        $(this).attr('aria-expanded', 'true');
33      }else{
34        $(this).attr('aria-expanded', 'false');
35      }
36    }
37  });
38
39  // 검색창
40  $('.util_area .search_ico').on('click', function(){
41    $('.main header').addClass('search');
42    $('.total_sch_wrap').fadeIn();
43  });
44
45  $('.total_sch_wrap .total_close').on('click', function(){
46    $('.main header').removeClass('search');
47    $('.total_sch_wrap').fadeOut();
48  });
49
50  // 햄버거메뉴
51  $('.ham_menu').on('click', function(){
52      $(this).toggleClass('open');
53      if($(this).hasClass('open')){
54        $('header').addClass('on');
55        $('body').addClass('modal');
56      }else{
57        $('header').removeClass('on');
58        $('body').removeClass('modal');
59      }
60  });
61
62  // 전체메뉴
63  $('.all_menu .allmenu_inner .m_close').on('click', function(){
64    $('.ham_menu').removeClass('open');
65    $('body').removeClass('modal');
66    $('header').removeClass('fix');
67  });
68
69  $('.nav_list > li .depth01').on('click', function(e){
70    if($(window).outerWidth() <= 1024){
71      if($(this).siblings('div').hasClass('depth02_area')){
72        e.preventDefault();
73      }
74      $('.nav_list > li .depth01').not($(this)).removeClass('on');
75      $(this).toggleClass('on');
76      $('.depth02_area').not($(this).siblings()).stop().slideUp();
77      $(this).siblings('.depth02_area').stop().slideToggle();
78    }else{
79    }
80  });
81
82  $(window).resize(function(){
83    if($(window).outerWidth() <= 1024){
84      $('body').removeClass('modal');
85    }
86    if($(window).outerWidth() >= 1024){
87      $('.depth02_area').css('height', 'auto').hide();
88      $('header').removeClass('on');
89      $('.depth01').removeClass('on');
90      $('.nav_list .depth01').removeClass('on');
91      $('.depth02').removeClass('on');
92      $('.depth01').removeClass('on');
93      $('.depth03_area').hide();
94      // $('.ham_menu').removeClass('open');
95    }
96  });
97
98// 포커스
99
100$('.nav_list .depth01').on('focus', function(){
101  if($(window).outerWidth() > 1024){
102    $('.depth02_area').stop().slideUp();
103    $(this).siblings('.depth02_area').stop().slideDown();
104  }
105});
106$('.logo a').on('focus', function(){
107  if($(window).outerWidth() > 1024){
108    $('.depth02_area').stop().slideUp();
109  }
110});
111$('.util_area .search_ico').on('focus', function(){
112  if($(window).outerWidth() > 1024){
113    $('.depth02_area').stop().slideUp();
114  }
115});
116
117
118// 헤더 사이트 셀렉트
119$('.hd_select > .select_btn').on('click', function(){
120  $('.hd_select').toggleClass('on');
121});
122$('.hd_select > ul li a').on('click', function(){
123  $('.hd_select').removeClass('on');
124});
125$('html').click(function (e) {
126  if (!$(e.target).parents().hasClass("hd_select")) {
127    $('.hd_select').removeClass('on');
128  }
129});
130
131// 푸터 패밀리사이트
132$('.ft_util .site_wrap .site_btn').attr('aria-expended', 'false');
133$('.ft_util .site_wrap .site_btn').on('click', function(){
134console.log("ㅡㅅ ㅡ");
135  $(this).toggleClass('on');
136  if($(this).hasClass('on')){
137    console.log("ㅡㅅ ㅡ!");
138    $(this).attr('aria-expended', 'true');
139  }else{
140  console.log("ㅡㅅ ㅡ!!!");
141    $(this).attr('aria-expended', 'false');
142  }
143});
144$('html').click(function (e) {
145  if (!$(e.target).parents().hasClass("site_wrap")) {
146    $('.ft_util .site_wrap .site_btn').removeClass('on');
147    $('.ft_util .site_wrap .site_btn').attr('aria-expended', 'false');
148  }
149});
150$('.ft_util .site_wrap ul li:last-of-type a').on('focus', function(){
151  $('.ft_util .site_wrap .site_btn').removeClass('on');
152});
153
154});
155
156$(function(){
157skipNav();   //내용 건너뛰기
158locationNav();   //서브페이지 메뉴 dropdown
159tabItem();   //탭 아이템 개수 이벤트
160tabLink();   //탭 버튼 클릭 이벤트
161tabMobile(); //탭 모바일 이벤트
162listItem();    //일반 아이템 개수 이벤트
163callPop();    //팝업 이벤트
164tableRespon(); //table 반응형 이벤트
165focusingFn(); //웹접근성 초점 이동
166
167// 네비게이션 title
168$(".location .inner .depth:nth-of-type(1)").find('a').attr('title','1차 메뉴');
169$(".location .inner .depth:nth-of-type(2)").find('a').attr('title','2차 메뉴');
170$(".location .inner .depth:nth-of-type(3)").find('a').attr('title','3차 메뉴');
171
172$('img').attr('title', '');
173var optionTxt1 = $('select option:first-child').text();
174var optionTxt2 = $('select option:nth-child(2)').text();
175var optionTxt3 = $('select option:nth-child(3)').text();
176var optionTxt4 = $('select option:nth-child(4)').text();
177
178  $('select').attr('title', '게시물 조건' + '|' + ' ' + optionTxt1 + ' ' + optionTxt2 + ' ' + optionTxt3 + ' ' + optionTxt4 + '|' + '선택');
179
180$(".location .home").attr('id', 'contents');
181$('.career_list .lists.paper').removeClass('num'); 
182$('.satis_open').on('click', function(){
183  console.log("ㅡㅅ ㅡ");
184  $('.satis_info').toggleClass('on');
185  $('#satisFull').focus();
186});
187$('.satis_info .close').click(function(){
188console.log("ㅡㅅ ㅡ!!!");
189  $('.satis_info').removeClass('on');
190  $('.satis_open').focus();
191});
192if($('img[usemap]').length > 0 )
193  $('img[usemap]').rwdImageMaps();  //이미지맵 반응형
194//$('a[href^="/kist_web"]:not(.direct_link a, .main_visual a, .mainRiNews a, .normalNotice a), a[href^="https://www.kist.re.kr/"]:not(.link_more)').attr('title', '').attr('target', '_self'); //링크 title값 변경
195$('a[href^="/kist_web"]:not(.direct_link a, .main_visual a, .mainRiNews a, .normalNotice a), a[href^="https://www.kist.re.kr/"]:not(.link_more)').attr('title', '').attr('target', '_blank'); //링크 title값 변경
196$('.btn_finder_s').attr('title', '검색')
197  $('.tab_wrap a.active').attr('title', '현재 선택된 탭');
198
199
200//접근성후 제거
201$('img[src$="_0.png"]').attr('title', '');
202
203var para = document.location.href.split("?"); 
204$('.url').text(para);
205if($('.url').text() == 'https://www.kist.re.kr/kist_web/,sub_num=4161&state=write&'){
206  $('title').text('KIST 한국과학기술연구원 | 고객의 소리 | 글쓰기');
207}else if($('.url').text() == 'https://www.kist.re.kr/kist_web/,cate=1&sub_num=4161&state=write&idx=75605&ord=10&pageNo=1'){
208  $('title').text('KIST 한국과학기술연구원 | 고객의 소리 | 수정');
209}else if($('.url').text() == 'https://www.kist.re.kr/kist_web/,sub_num=4161&state=view&idx=75511&ord=10'){
210  $('title').text('KIST 한국과학기술연구원 | 고객의 소리 | 비밀번호 입력');
211}
212
213$('.board_paging').addClass('mt_3');
214$('.p_first, .first').attr('title','처음으로 이동');
215$('.p_pri, .prev').attr('title','이전으로 이동');
216$('.p_next, .next').attr('title','다음으로 이동');
217$('.p_last, .last').attr('title','마지막으로 이동');
218//$('a[href^="?sub_num="]').attr('title', '페이지 이동');
219$('img[src$="icon_depart_email.png"]').parent().append('<span class="hidden">이메일 보내기</span>');
220$('img[src$="icon_depart_paper.png"]').parent().append('<span class="hidden">연구논문 보기</span>');
221$('.depart_list button').attr('title', '구성원소개 이동');
222$('a[href="http://kist_school.kist.re.kr/main"]').attr('target','_blank');
223$('.newestRe').parent().addClass('modi0924');
224$('select + input:text').attr('title', '검색어 입력');
225$('select + input:text + button, select + input:text + input:submit').attr('title', '검색');
226$('.board_paging strong').attr('title', '선택됨');
227$('a[href="/kist_web/?sub_num=4075"]').attr('href', 'https://library.kist.re.kr/main.do').attr('target', '_blank');
228$('input[name="ste"]').next('input').remove();
229
230$('.gov_ruls_tab li a').click(function(){
231  $('.gov_ruls_tab li a').attr('title', '');
232  $(this).attr('title', '선택됨');
233});
234$('.paination a.on').attr('title', '선택됨');
235$('#pc-gnb-menu-726').remove();
236$('.ko.board.view.co-board .b-content-box table').wrap('<div class="board-table"></div>');
237});
238
239
240function skipNav(){//skip navigation
241$('#skip_nav dd a').focus(function(){
242  $('#skip_nav dd').addClass('on');
243});
244$('#skip_nav dd a:last-child').focusout(function(){
245  $('#skip_nav dd').removeClass('on');
246});  
247}
248
249
250
251function locationNav(){//서브 로케이션 메뉴
252$('.depth').setMenu();
253}
254
255$.fn.setMenu = function () {//서브 로케이션 메뉴
256var depth1LI = $('> a', this);
257var depth2UL = $('> ul', this);
258
259//첫 메뉴 선택
260var menu = $('.depth:first-child', this);
261menu.addClass('active');
262
263if ($('>ul', menu).length > 0) {
264  $('>ul', menu).slideDown("fast");
265  menu = $('>ul>li:first', li);
266  menu.addClass('active');
267  if ($('>ul', menu).length > 0) {
268    $('>ul', menu).slideDown("fast");
269    menu = $('>ul>li:first', li);
270    menu.addClass('active');
271  } else {
272  }
273} else {
274}
275//첫 메뉴 선택
276$('a', this).click(function () {
277  var depth = $(this).parent();
278  var sibling = depth.siblings();
279
280  sibling.removeClass('active').find('>a').attr('aria-expanded', 'false');
281  $('ul', sibling).slideUp("fast");
282  depth.toggleClass('active');
283
284  if(depth.hasClass('active')) {
285    $(this).attr('aria-expanded', 'true');
286  } else {
287    $(this).attr('aria-expanded', 'false');
288  }
289
290  var ul = $('>ul', depth);
291  if (ul.length > 0) {
292    ul.slideToggle("fast", function () {
293      //$('body').setLayout();
294    });
295    return false;
296  } else if ($(this).attr('target') != '_blank') {
297  }  
298});
299}
300
301function tabItem(){ //탭 메뉴 개수
302  var tabNum = $(".tab_wrap").children().length;
303  
304if(tabNum >= 1 && $(".tab_wrap").length < 2){
305  $(".tab_wrap").addClass('tab' + tabNum);
306  }
307  
308}
309
310function tabLink(){ //탭 스크립트
311$('.tab_wrap button').click(function(){
312  $('.tab_wrap button').removeClass('on');
313  $('.tab_cont').removeClass('on');
314  $(this).addClass('on');
315  $('#' + $(this).data('id')).addClass('on');
316});
317$(".career_list > .btn_wrap button").click(function(){
318  $(".career_list > .btn_wrap button").removeClass('on');
319  $(".career_list .tab_cont").removeClass('on');
320  $(this).addClass('on');
321  $("#"+$(this).data('id')).addClass('on');
322});
323
324$('.subtab_wrap a').on('click',function(){
325  var anchorId = $(this).attr('data-anchor');
326  // 스크롤 이동
327  scroll_to_anchor_tab(anchorId);
328});
329function scroll_to_anchor_tab(anchor_id,speed) {
330  
331  if( !speed ) var speed = 'slow';
332  var a_tag = $("#"+anchor_id);
333  if(a_tag.length > 0){
334    $('html, body').animate({
335      /*scrollTop: a_tag.offset().top - $('header').height()*2.5*/
336      scrollTop: a_tag.offset().top - $('header').height()-400// 상단에 특정 위치를 제외하고 스크롤할때 해당 이름 작성
337    }, speed);
338  }
339}
340}
341
342function listItem(){ //리스트 메뉴 개수
343var tabNum = $(".depart_list").children().length;
344var tabNum2 = $(".field_list > ul").children().length;
345if(tabNum >= 1){
346  $(".depart_list").addClass('list_' + tabNum);
347}
348if(tabNum2 >= 1){
349  $(".field_list > ul").addClass('list_' + tabNum2);
350}
351}
352
353
354function callPop(){
355$('.popup').on('click', function(){
356  var cp = $(this);
357  var tabDisable;
358  var nowScrollPos = $(window).scrollTop();
359
360  $('body').css('overflow', 'hidden');
361  $("#" + $(this).data('id')).parents('.pop-wrap').show();
362  $("#" + $(this).data('id')).show();
363  $('.pop-cont .close button').focus();
364
365
366  function popClose(){
367    $('body').css('overflow', 'auto');
368    $(window).scrollTop(nowScrollPos);
369    $('.pop-wrap').hide();
370    $('.core, .abstract_cont').hide();
371    self.focus();
372    cp.focus();
373  };
374  $('.pop-wrap').find('.close, .close button').on('click', popClose);
375  $('.pop-wrap').find('.pop-bg').on('click', popClose);
376
377});
378$('.close_all').click(function(){
379  $(this).parents('.abstract_cont').hide();
380});
381
382}
383
384function tabMobile(){  //탭 모바일 이벤트
385var cont_w = $('.wrap').width();
386var tab_txt = $('.tab_wrap .on').text();
387var tab_apptxt = "";
388var tab_apptxt = tab_apptxt + "<button type='button' class='btn'>" + tab_txt + "</button>";
389
390var btn_txt = $('.sel_box > .btn_wrap .on').text();
391var btn_apptxt = "";
392var btn_apptxt = btn_apptxt + "<button type='button' class='btn'>" + btn_txt + "</button>";
393
394$('.content .tab_wrap button').remove();
395$('.tab_wrap .tab_mo').contents().unwrap();
396
397$('.sel_year + .btn_wrap button').remove();
398$('.btn_wrap .btn_mo').contents().unwrap();
399
400if(cont_w < 800 && $('.tab_wrap').parents('.admin-view').length <= 0){
401  $('.tab_wrap').prepend(tab_apptxt);
402  $('.tab_wrap a').wrapAll('<div class="tab_mo"></div>');
403  $('.sel_year + .btn_wrap').prepend(btn_apptxt);
404  $('.sel_year + .btn_wrap a').wrapAll('<div class="btn_mo"></div>');
405  $('.main_visual .swiper-slide:nth-child(2) a.btn').children('img').attr('src', '/_res/kist/ko/img/common/icon/icon_arrow_w.png');
406  $('.tab_wrap.gov button').text('정부3.0정보공개');
407}
408
409$('.tab_wrap button').click(function(){
410  if($('.tab_mo').css('display') == 'none'){
411    $(this).next().slideDown('swing');
412  }else{
413    $(this).next().slideUp('swing');
414  }
415});
416
417$('.sel_year + .btn_wrap button').click(function(){
418  if($('.btn_mo').css('display') == 'none'){
419    $(this).next().slideDown('swing');
420  }else{
421    $(this).next().slideUp('swing');
422  }
423});
424
425}
426
427
428function tableRespon(){  
429$('.ct').addClass('respon');
430}
431
432$(window).resize(function() {
433  if(this.resizeTO) {
434      clearTimeout(this.resizeTO);
435  }
436  this.resizeTO = setTimeout(function() {
437      $(this).trigger('resizeEnd');
438  }, 300);
439});
440
441$(window).on('resizeEnd', function() {
442tabMobile();
443});
444
445//scroll popup :: follow
446$(window).scroll(function() {
447var position = $(window).scrollTop();
448var num = $("#content").height() - $(".pop-cont").height();
449
450if(position <= num){
451$('.pop-cont').stop().animate({'top':position+'px'},0);
452$('.pop-cont.abstract_wrap').stop().animate({'bottom':position+'0px'},0);
453}
454});
455
456$(window).on('scroll', function(){ 
457//var scrollTop = $(window).scrollTop();
458var scTop = $(this).scrollTop();
459  if ( scTop > 50) {
460  $('header').addClass('solid');
461  } else {
462  $('header').removeClass('solid');
463  };
464   if ( scTop > 1000) {
465  $('.search_box').hide();
466  } else {
467  $('.search_box').show();
468  };
469}).trigger('scroll');
470
471
472function changeEmail(obj,changeObj) {
473var selectElement = document.getElementById(obj); 
474var selectValue = selectElement.value;
475document.getElementById(changeObj).value = selectValue;
476}
477
478
479function focusingFn(){
480$('a[href="https://library.kist.re.kr/main.do"], a[href="/ko/news/science-and-technology-outlook.do"], a[href$="/ko/notice/vkist-establishment-support-project.do"], a[href$="/ko/clean/account-of-love.do"], a[href$="/ko/intro/four-seasons-of-kist.do"], a[href$="/ko/participate/stop-job-request-center.do"]').addClass('depth2Last');
481
482$('#gnb > ul > li > a').focus(function(){
483  $(this).addClass('hover');
484  $('header').addClass('on');
485  gnb_Open();
486});
487
488$('.btn_finder').focus(function(){
489  $('#gnb > ul > li > a').removeClass('hover');
490  $('header').removeClass('on');
491  gnb_Close();
492});
493
494$('.fp-viewing-firstPage #submitQues').focusout(function(){
495  $('.mainLeNotice button').focus();
496});
497
498//Shift Tab 이벤트
499$("#gnb ul li:first-child > a").keydown(function(event){ 
500  var v_keyCode = event.keyCode || event.which; 
501  if(v_keyCode == 9){ 
502    if(event.shiftKey){ 
503      gnb_Close();
504      $('.gnb > ul > li > a').removeClass('hover');
505    }else{ 
506      gnb_Open();
507    } 
508  } 
509});
510$("#gnb > ul > li > a").keydown(function(event){ 
511  var v_keyCode = event.keyCode || event.which; 
512  if(v_keyCode == 9){ 
513    if(event.shiftKey){ 
514      $(this).removeClass('hover');
515    }
516  } 
517});
518$(".depth2Last").keydown(function(event){ 
519  var v_keyCode = event.keyCode || event.which; 
520  if(v_keyCode == 9){ 
521    if(event.shiftKey){ 
522    }else{
523      $(this).parents('.depth_2').prev('a').removeClass('hover');
524    }
525  } 
526});
527$(".direct_link li:last-child a").keydown(function(event){ 
528  var v_keyCode = event.keyCode || event.which; 
529  if(v_keyCode == 9){ 
530    if(event.shiftKey){ 
531    }else{
532      $('.blank').focus();
533    }
534  } 
535});
536$(".search_box button").keydown(function(event){ 
537  var v_keyCode = event.keyCode || event.which; 
538  if(v_keyCode == 9){ 
539    if(event.shiftKey){ 
540    }else{
541      $('button[data-id="kistResult"]').focus();
542    }
543  } 
544});
545$(".jwvalid-must b-input type02").keydown(function(event){ 
546  var v_keyCode = event.keyCode || event.which; 
547  if(v_keyCode == 9){ 
548    if(event.shiftKey){ 
549    }else{
550      $('.unreason_wrap .border1 scroll p').focus();
551    }
552  } 
553});
554
555//Enter 이벤트
556$(".popup").on("keyup",function(key){
557      if(key.keyCode==13) {
558          $('.close button').trigger('focus');
559      }
560  });
561$(".slide_control .swiper-button-pause").on("keyup",function(key){
562      if(key.keyCode==13) {
563          $(this).toggleClass('off');
564      }
565  });
566}
567
568/* 웹 접근성 스크립트 */
569/* a 태그 전체 접근성 일괄 적용*/
570$('#cms-content a[target="_blank"]').attr('title', '새 창으로 열기');
571/* img 태그 전체 접근성 일괄 적용*/
572$('img:not([alt])').attr('alt', '');

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.