PageSourceSearch

https://www.pcccr.go.kr/template/resources_eng/fs/js/fs_common.js

js pcccr.go.kr collected 2026-10-04 04:02:49 UTC 9,918 bytes, 263 lines download raw bytes

1$(function() {
2    //건너뛰기 포커스이동
3    $(".skip_nav:eq(0)").click(function(){
4        $("#fs_container_wrap").attr("tabindex", -1).focus();
5    });
6    $(".skip_nav:eq(1)").click(function(){
7        $("#fs_top_menu").attr("tabindex", -1).focus();
8    });
9    $(".skip_nav:eq(2)").click(function(){
10        $("#fs_footer").attr("tabindex", -1).focus();
11    });
12/*
13    //헤더영역
14    //마우스가 들어갔을때
15    $('.fs_top_menu').mouseover(function(){
16        $('#fs_header').addClass('on');
17    });
18    //마우스가 나갔을때
19    $('.fs_top_menu').mouseout(function(){
20        if(!$(document).scrollTop() > 0){
21            $('#fs_header').removeClass('on');
22        }
23        if($(this).next().hasClass('open')){
24            $('#fs_header').addClass('on');
25        }
26        $('#fs_header').removeClass('on');
27    });
28
29    //전체메뉴
30    function chk(){
31        if(cc == 1){
32            $(".fs_top_menu ul.lnb > li > ul").stop(true,false).show();
33        }else{
34            $(".fs_top_menu ul.lnb > li > ul").stop(true,false).hide();
35        }
36    }
37
38    //마우스가 들어갔을때
39    $('.fs_top_menu > ul.lnb > li').mouseover(function(){
40        setTimeout(chk);
41        cc = 1;
42        $(this).addClass('on');
43        $(this).parent().parent().parent().next('.lnb_bg').toggleClass('on');
44    });
45    //마우스가 나갔을때
46    $('.fs_top_menu > ul.lnb > li').mouseout(function(){
47        setTimeout(chk);
48        cc = 0;
49        $(this).removeClass('on');
50    });
51
52    //포커스가 들어갔을때
53    $('.fs_top_menu ul.lnb li').focus(function(){
54        setTimeout(chk);
55        cc = 1;
56        $(this).parent().parent().addClass('on');
57    });
58    //포커스가 나갔을때
59    $('.fs_top_menu ul.lnb li a').blur(function(){
60        setTimeout(chk);
61        cc = 0;
62        $('.fs_top_menu ul.lnb li').removeClass('on');
63    });*/
64
65
66    //전체메뉴(접근성 기능 포함)
67    function chk(){
68        if(cc == 1){
69            $("#fs_header .lnb_bg").stop(true,false).slideDown(400);
70            $(".fs_top_menu ul.lnb > li > ul").stop(true,false).slideDown(400);
71            $(".fs_top_menu .lnb > li.em_lnb .lnb_layer01").slideDown(400);
72        }else{
73            $("#fs_header .lnb_bg").stop(true,false).slideUp(400);
74            $(".fs_top_menu ul.lnb > li > ul").stop(true,false).slideUp(400);
75            $(".fs_top_menu .lnb > li.em_lnb .lnb_layer01").slideUp(400);
76        }
77    }
78    var $header = $('#fs_header'),
79        $dep1 = $(".lnb > li"),
80        $lnbBg = $(".lnb_bg");
81    $dep1.on("mouseenter", function () {
82        $header.addClass('lnbHover');
83    }).on(" mouseleave", function () {
84        $header.removeClass('lnbHover');
85    });
86    $lnbBg.on("mouseenter", function () {
87        $header.addClass('lnbHover');
88    }).on(" mouseleave", function () {
89        $header.removeClass('lnbHover');
90    });
91
92
93
94    //스크롤시 상단 고정
95    $(window).scroll(function () {
96        if ($(this).scrollTop() > 150) {
97            $('body').addClass('scroll');
98        } else {
99            $('body').removeClass('scroll');
100        }
101    });
102
103    //모바일메뉴
104    $('.fs_head .mbtn_box .mbtn').click(function(){
105        $('body').toggleClass('overlay');
106        $('.fs_head .mbtn_box .mbtn').toggleClass('close');
107        $('.fs_mtop_menu').toggleClass('open');
108        $('#fs_header').toggleClass('on');
109        $('.fs_mtop_menu').html($('.fs_top_menu').html());
110        $(".fs_mtop_menu .lnb li .lnb_title").click(function(e) { e.preventDefault(); });//링크 안걸리게
111    });
112    $(document).on("click", ".fs_mtop_menu .lnb_title", function (){
113        if ($(this).parent().hasClass('on')) {
114            $(this).parent().removeClass('on');
115            $(this).siblings('.lnb_layer01').slideUp(400);
116        } else {
117            $('.lnb li').removeClass('on');
118            $(this).parent().siblings().removeClass('on');
119            $(this).parent().siblings().children('.lnb_layer01').slideUp(400);
120            $(this).parent().addClass('on');
121            $(this).siblings('.lnb_layer01').slideDown(400);
122        }
123    });
124    
125    //하위메뉴 없으면 lnb_title CLASS 제거
126    $("#fs_top_menu .lnb li").each(function(index, item){
127        if($(item).find("ul").length == 0) {
128            $(item).find("a").removeClass("lnb_title");
129        }
130    });
131
132
133
134    //왼쪽메뉴
135    menu_left();
136
137    function menu_left(){
138        $(".sub_menu .dep3").hide();
139        $(".sub_menu .dep4").hide();
140        $(".sub_menu a.deplink").click(function(e) { e.preventDefault(); });//링크 안걸리게
141        $(".sub_menu .dep2 > li.on").find(".dep3").show();
142        $(".sub_menu .dep2 > li > .dep3 > li.on").find(".dep4").show();
143        $(".sub_menu .dep2 > li > a").click(function(){
144            $(".sub_menu .dep2 > li .dep3").slideUp();
145            $(".sub_menu .dep2 > li").removeClass("on");
146
147            if(!$(this).next().is(":visible")) {
148                $(this).next().slideDown();
149                $(this).parent().addClass("on");
150                //$(this).addClass("deplink");
151            }
152        });
153        $(".sub_menu .dep2 > li > .dep3 > li > a").click(function(){
154            $(".sub_menu .dep2 > li > .dep3 > li .dep4").slideUp();
155            $(".sub_menu .dep2 > li > .dep3 > li").removeClass("on");
156            if(!$(this).next().is(":visible")) {
157                $(this).next().slideDown();
158                $(this).parent().addClass("on");
159            }
160        });
161        return false;
162    }
163
164
165    //관련사이트
166    $('.family_site > li > button').on('click', function () {
167        var currentLi = $(this).parent('li');
168        $('.family_site > li').not(currentLi).removeClass('on').find('.family_link').stop(true, true).slideUp();
169        currentLi.toggleClass('on').find('.family_link').stop(true, true).slideToggle();
170    });
171    $('.family_site > li .family_link > ul > li:last-child').focusout(function () {
172        $(this).parent().parent('li').removeClass('on').find('.family_link').stop(true, true).slideUp();
173    });
174});
175
176
177//반응형
178(function($) {
179	'use strict';
180	var $window = $(window);
181	$(function() {$('table.responsive').not($('.prettyprint').children()).each(function() {
182            var RowSpanExist = $(this).find('td, th').is('[rowspan]'),
183                TheadExist = $(this).find('thead').length;
184            if((RowSpanExist==false) && (TheadExist!=0)){//rowspan이 없을 경우만 실행 (rowspan이 있으면 지원불가)
185                $(this).children('tbody').children('tr').find('th, td').each(function() {
186                    var ThisIndex = $(this).index(),
187                        TheadText = $(this).parents('tbody').siblings('thead').find('th').eq(ThisIndex).text();
188                    $(this).attr('data-content', TheadText);
189                });
190                $(this).children('tfoot').children('tr').find('th, td').each(function() {
191                    var ThisIndex = $(this).index(),
192                        TheadText = $(this).parents('tfoot').siblings('thead').find('th').eq(ThisIndex).text();
193                    $(this).attr('data-content', TheadText);
194                });
195            };
196		});
197	});
198})(window.jQuery);
199
200
201//공통탭
202function initTabs(parentTabContentClass, parentTabButtonClass, childTabContentClass, childTabButtonClass) {
203    $(parentTabButtonClass).on('click', function() {
204        var parentIndex = $(this).index();
205        var parentTabContent = $(parentTabContentClass);
206        var parentTabButton = $(parentTabButtonClass);
207
208        parentTabContent.removeClass('on');
209        parentTabButton.removeClass('on').find('> span').removeAttr('title');
210
211        parentTabContent.eq(parentIndex).addClass('on');
212        $(this).addClass('on').find('> span').attr('title', '선택됨');
213
214        var childTabContent = parentTabContent.eq(parentIndex).find(childTabContentClass);
215        var childTabButton = parentTabContent.eq(parentIndex).find(childTabButtonClass);
216
217        childTabContent.removeClass('on');
218        childTabButton.removeClass('on').find('> span').removeAttr('title');
219
220        childTabContent.eq(0).addClass('on');
221        childTabButton.eq(0).addClass('on').find('> span').attr('title', '선택됨');
222    });
223
224    $(childTabButtonClass).on('click', function() {
225        var parentTabContent = $(this).closest(parentTabContentClass);
226        var childIndex = $(this).index();
227        var childTabContent = parentTabContent.find(childTabContentClass);
228        var childTabButton = parentTabContent.find(childTabButtonClass);
229
230        childTabContent.removeClass('on');
231        childTabButton.removeClass('on').find('> span').removeAttr('title');
232
233        childTabContent.eq(childIndex).addClass('on');
234        $(this).addClass('on').find('> span').attr('title', '선택됨');
235    });
236}
237
238//프린트기능
239
240function printPageArea(areaID){
241    var printContent = document.getElementById(areaID).innerHTML;
242    var originalContent = document.body.innerHTML;
243    document.body.innerHTML = printContent;
244    window.print();
245    document.body.innerHTML = originalContent;
246}
247
248
249
250function Accordion() {
251    jQuery('.accordion_sbj').on('click',function() {
252        var faqOn = jQuery(this).closest('.accordion_list');
253        if (!faqOn.hasClass('on')) {
254            jQuery(this).closest('.accordion_list').children('.accordion_ans').slideDown();
255            jQuery(this).closest('.accordion_list').addClass('on');
256        } else if (faqOn.hasClass('on') == true ){
257            jQuery(this).closest('.accordion_list.on').children('.accordion_ans').slideUp();
258            jQuery(this).closest('.accordion_list').removeClass('on');
259        }
260        return false;
261    });
262}
263

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.