/* * Name: KEPCO * Part: JavaScript for design * Author : [써냐]BLUEWEBD™ */ /* design for CSS*/ $(document).ready(function() { colRowSpanBorder(); // colspan, rowspan border 제어 radioShowHide();// 라디오버튼 SHOW.HIDE titBottomReqM();// 제목 하단 문구 나올때 여백조정 /*홍보센터*/ prFn(); $(".class").css({ "background":"#000", "opacity":"0.7" }); /* 이미지 갤러리 미리보기 리스트 이미지 오버효과 */ var thumbOj = $('.thumbMask'); var thumbMask = $('.thumbMask img'); thumbOj.each(function() { if(thumbOj.parents('li').hasClass('on')){ thumbOj.parents('li.on').find('span').css({'background': 'none'}) } $(this).hover(function(){ var objThisParntOn = $(this).parents('li') $(this).css({ "height":"100%", "background":"#000" }); $(this).find('img').css({ "opacity":"0.5" }); if(objThisParntOn.hasClass('on')){ $(this).css({ "background-color":"none", "opacity":"1" }); $(this).find('img').css({ "opacity":"1" }); } },function(){ thumbOj.css({ "background":"none" }); thumbMask.css({ "opacity":"1" }); }); }); $(".conSection>.scbox:last-child").css({"margin-bottom": "0px"}); $(".conSection>.comment:last-child").css("margin-bottom","0px"); $("#popBody .box_info>.bul_4dep_list:last-child").css("margin-bottom","0px"); $("#popBody .conSection:last-child > .btn_bbs").css("margin-bottom","0px"); $('ol.accept_step li:last-child').css({'width': '135px', 'padding': '0 0 0 10px', 'margin-right': '0'}); //기업센터 신청내역 , 진행현황 $("#ID li:nth-child(even)").css("margin-right","0px"); $(".class li:nth-child(even)").css("background-color","#f5f5f5"); // li 2개 기준 $(".gallery_list_box>.gallery_list > li").each(function(){ if(($(this).index() + 1) % 3 == 0){ $(this).css("margin-right","0px"); } if($(this).index() < 3){ $(this).css("margin-top","0px"); } }); $(".gallery_srch .gallery_list_box>.gallery_list > li").each(function(){ if(($(this).index()) % 4 == 2 || ($(this).index()) % 4 == 1){ $(this).css("margin-right","20px"); } if($(this).index() < 4){ $(this).css("margin-top","0px"); } if(($(this).index()) % 4 == 3){ $(this).css("margin-right","0px"); } }) // li 5개 기준 $(".gallery_perv_box .gallery_list > li").each(function(){ if(($(this).index() + 1) % 5 == 0){ $(this).css("margin-right","0px"); } }); // li 5개 기준 $(".vedio_prev_list > li").each(function(){ if(($(this).index() + 1) % 4 == 0){ $(this).css("margin-right","0px"); } }); /*전기박물관 영상자료*/ $(".electricMuseum03 .gallery_list_box>.gallery_list > li").each(function(){ if(($(this).index()) % 4 == 2){ $(this).css("margin-right","14px"); } if($(this).index() < 4){ $(this).css("margin-top","0px"); } if(($(this).index()) % 4 == 3){ $(this).css("margin-right","0px"); } }) $(".prGallery .vedio_prev_list > li").each(function(){ if(($(this).index() + 1) % 5 == 4){ $(this).css("margin-right","11px"); } if(($(this).index() + 1) % 5 == 0){ $(this).css("margin-right","0px"); } }); /* PART : 전국사업소 지사리스트 2줄 이상일 경우 */ $(".office_lst .sub_layer > li").each(function(){ if(($(this).index() + 1) % 9 == 0){ $(this).css({ "padding-left":"0px", "background":"none", "clear":"left" }); $(".office_lst").css({ "margin-bottom":"97px" }); } }); var bbsBoxLi = $('.bbs_box .bbs_view dl.view dd.log_list ul li'); var bbsBoxLiLength = bbsBoxLi.length; for(i = 1; i.conSection'); var objbul3DepList = $('.conSection>.bul_3dep_list'); var objSelfIntro = $('.self_intro'); var intConSection = objConSection.length; var intbul3DepList = objbul3DepList.length; var intSelfIntro = objSelfIntro.length // 마지막 conSection 마진 조정 objConSection.each(function(){ objConSection.eq(intConSection - 1).not(objPopConSection).css({"margin-bottom":"43px"}); }); objbul3DepList.each(function(){ objbul3DepList.eq(intbul3DepList - 1).css("margin-bottom","0px"); }); objSelfIntro.each(function(){ objSelfIntro.eq(intSelfIntro - 1).css('margin-bottom', '0px'); }); /*기본 메뉴 탭 하위 클릭시 활성화*/ var subLink = $('.sub_layer li'); subLink.each(function(index) { $(this).click(function(){ subLink.removeClass('sub_on'); $(this).addClass('sub_on') }); }); //홍보센터 달력 이름 클릭 시 레이어 $('.layer_cal') .hide(); var objListReservA = $('.list_reserv li>a, .name a'); $('.box_layer .close a').click(function(){ $('.layer_cal') .hide(); return false; }); objListReservA.each(function(){ $(this).click(function(){ $(this).nextUntil('layer_cal').show(); return false; }); }); //고객센터 - 분류선택 $("ul.sub_split > li").each(function(){ if(($(this).index() + 1) % 4 == 0){ $(this).addClass("first"); } }); // 필터링 TAB 2depth 구분 $(".tab_table_sub ul.tabmenu_sub>li").each(function(){ if(($(this).index() + 1) % 4 == 0){ $(this).css("background","none"); } }); }); var rollBanner = function(){ var objImg = $('.banner_img img') var objLi = $('.banner_img li') var objLiOn = $('.banner_img li.on') var objButton = $('.banner_img a') objImg.hide(); if(objLi.hasClass('on')){ objLiOn.find('img').show(); } objButton.each(function(index){ $(this).click(function(){ objLi.removeClass('on'); objImg.hide(); $(this).parent('li').addClass('on').find('img').show(); return false; }) }) } var tabLayerShowHide = function(){ var objH2Tab = $('h2>a'); var objH2TabParent = objH2Tab.parent(); var objDlLayer = $('.reservLayer'); objH2Tab.each(function(index){ objDlLayer.hide(); if(objH2TabParent.hasClass('on')){ $('h2.on').next().show(); } $(this).click(function(){ objH2TabParent.removeClass('on'); /*전기에너지관 탭*/ wrapTabType1() $(this).parent().addClass('on'); objDlLayer.hide(); $(this).parent().next().show(); $(this).parent().next().find('.banner_img li').removeClass('on').end().find('.banner_img li:eq(0)').addClass('on').end().find('.banner_img li:eq(0) img').show(); return false; }) }) } var tabLi = function(){ var objLi = $('.tab li'); var objLiA = $('.tab li a'); objLiA.each(function(index){ $(this).click(function(){ objLi.removeClass('on') ; $(this).parent().addClass('on'); }) }) } var radioShowHide = function(){ var objRadio = $("input[type='radio']"); objRadio.each(function(index){ var current = index + 1; var objRadioBoxId = $('.radio_shLayer').attr('id'); $('.radio_shLayer').hide(); $(this).click(function(){ if($('div').is($('.radio_shLayer'))){ var objRadioClass = objRadio.addClass('btnRadio'); var intRadio = $(this).attr('class') + current; var intRadioClass = parseInt(intRadio.charAt(intRadio.length-1)); var showHideBox = objRadioBoxId.substring(0,(objRadioBoxId.length - 1)) + intRadioClass; $('.radio_shLayer').hide(); $('#'+showHideBox).show(); } }); }); } var prFn = function(){ prListFn(); //홍보센터 PR TODAY, MONTHLY LIST /*홍보센터 롤링배너*/ rollBanner(); /*홍보센터 통합예약 탭*/ tabLayerShowHide(); /*홍보센터 탭*/ tabLi(); /*홍보센터 전기에너지관 탭*/ prTabFn(); /* 전시관 우측배너 배경 이미지 오버효과 */ prRsideOver(); /*스마트그리드*/ prSmartImg(); /*전자계이해증진관*/ prEmf(); /*765kv*/ tr765kV(); /*서브메인*/ prSubMain(); } var prListFn = function(){ /*홍보센터 PR today list*/ var objTodayListli = $('.today_list li'); var objMonthlyList = $('.monthly_list li'); for(i=1 ; i') layerThumbBtnA.find('.bg').css({ 'background-color': '#000', "opacity":"0.7" }); $('.layer.on .bg').css({ "opacity":"0" }) layerThumbBtnA.each(function(index){ layerThumbBtnA.parent().eq(index).css({'left': (layerThumbBtnWidth * index) + (5 * (index + 1)) + 'px'}); $(this).click(function(){ layerType2.hide(); layerType2.parent().removeClass('on'); layerType2.eq(index).show(); layerType2.eq(index).parent().addClass('on'); layerThumbBtnA.find('.bg').css({ "opacity":"0.7" }); $('.layer.on .bg').css({ "opacity":"0" }) return false; }) }) /*전기박물관 이미지 리스트*/ var objMoreListLi = $('.more_list li'); objMoreListLi.each(function(index){ if(($(this).index() + 1) % 5 == 0){ $(this).css({'margin-left': '0px'}); } if($(this).index() > 3){ $(this).css({'margin-top': '14px'}) } }) /*$('.gallery_list.vedio_prev_list li.on').bind('mouseenter focus', function(){ $(this).css({'background': 'none'}) })*/ } /*전기에너지관 탭*/ var wrapTabType1 = function(){ var tabTitType1 = $('.wrap_tab.type1 .tab_tit'); var width0 = tabTitType1.eq(0).outerWidth(); var width1 = tabTitType1.eq(1).outerWidth(); var width2 = tabTitType1.eq(2).outerWidth(); var width3 = tabTitType1.eq(3).outerWidth(); tabTitType1.eq(0).css({'border-left': '1px solid #dddddd'}) $('.wrap_tab.type1 .tab_tit.on').css({'border-left': 'none'}); tabTitType1.eq(1).css({'left': width0 -0 + 'px'}) tabTitType1.eq(2).css({'left': (width0 + width1 -1) + 'px'}) tabTitType1.eq(3).css({'left': (width0 + width1 + width2 -2 ) + 'px'}) tabTitType1.eq(4).css({'left': (width0 + width1 + width2 + width3 -3 ) + 'px'}) } /*var titBottomReqM = function(){ $('.h2tit + .txt_table_info, .h3tit + .txt_table_info, .h2tit + .limit_num,.h2tit + .board_align, .h3tit + .board_align').css({ 'margin-top': '-24px' }); $('.h2tit + .btn_file, .h3tit + .btn_file').css({ 'margin': '-36px 0 9px' }); }*/ var titBottomReqM = function(){ $('.h2tit + .limit_num,.h2tit + .board_align, .h3tit + .board_align').css({ 'margin-top': '-24px' }); $('.h2tit + .btn_file, .h3tit + .btn_file').css({ 'margin': '-36px 0 9px' }); } var colRowSpanBorder = function(){ $("th:last-child, td:last-child").not($('.tabmenu th:last-child, .tabmenu td:last-child')).css("border-right", "none"); $('th[scope=rowgroup]').css('border-right', '1px solid #b3d2e9'); $('.table_list thead tr th').css('border-bottom', '1px solid #b3d2e9'); $('.table_list thead tr:last-child th').css('border-bottom','none'); $('th.lineL, td.lineL').css({'border-left': '1px solid #b3d2e9'}); $('th.lineR, td.lineR').css({'border-right': '1px solid #b3d2e9'}); var objTheadTh = $('.table_list thead th'); var objTd = $('.table_list td'); /* table th 보더 값*/ objTheadTh.each(function(index){ var rowspan = objTheadTh.eq(index).attr('rowspan'); if(rowspan > 1){ $(this).css({"border-bottom":"none"}); }; if($('.table_list thead tr:first-child th:last-child').eq(index).attr('rowspan') > 1){ $('.table_list thead tr:first-child th:last-child') .css('border-left','1px solid #b3d2e9'); if($('th[scope=colgroup]:first-child')){ $('th[scope=colgroup]:first-child').css('border-left', 'none'); } }; }); var objTableList = $('.table_list'); //table_list thead tr 이 2이상 일때 보더값 설정 objTableList.each(function(index){ var rowCount = $('thead tr', this).length; if(rowCount > 1){ if(objTableList.find('th').eq(0).attr('rowspan') > 1){ objTableList.find('thead tr').eq(1).find('th').css({'border-left':'solid 1px #b3d2e9'}); } } }) /*table td 보더 값*/ objTd.each(function(index){ var rowspan = objTd.eq(index).attr('rowspan'); if(rowspan > 1){ $(this).not('.table_list td:last-child').css({"border-right":"1px solid #b3d2e9"}); }; }) } var prTabFn = function(){ /*홍보센터 전기에너지관 탭*/ var tabType2Li = $('.tablayer.type2 li') var tabType3Li = $('.tablayer.type3 li') for(i=5 ; i