/* * 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'}); }*/ thumbOj.hover(function(){ var objThisParntOn = $(this).parents('li'); $(this).css({ "height":"100%", "background":"#000" }); $(this).find('img').css({ "opacity":"0.4" }); if(objThisParntOn.hasClass('on')){ $(this).css({ "background-color":"none", "opacity":"1" }); $(this).find('img').css({ "opacity":"1" }); } },function(){ thumbOj.find('a').removeClass('on'); thumbOj.css({ "background":"none" }); thumbMask.css({ "opacity":"1" }); }); //}); /*마지막 요소의 마진값 초기화*/ $(".conSection>.scbox:last-child").css({"margin-bottom": "0px"}); $(".conSection>.comment:last-child").css("margin-bottom","0px"); $(".conSection>.scbox:last-child>.comment").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"); $("#popBody .conSection:last-child").css("margin-bottom","30px"); $("#popBody .conSection:last-child > .scbox:last-child").css("margin-bottom","0px"); $('ol.accept_step li:last-child').css({'width': '135px', 'padding': '0 0 0 10px', 'margin-right': '0'}); //기업센터 신청내역 , 진행현황 $(".box_info.type2 > dl > dd:last-child >ul:last-child").css("margin-bottom","0px"); // 2013.04.24 | 김미선 | 하단 알림박스 스타일 정의 $(".box_info.type2 > dl > dd:last-child >ul:last-child > li:last-child > ul:last-child").css("margin-bottom","-5px"); // 2013.04.24 | 김미선 | 하단 알림박스 스타일 정의 var objAlignRight = $('.board_align').find('.area_right'); //.area_right 가 있을 경우 if(objAlignRight){ //.area_right 각각에 objAlignRight.each(function(){ //.area_right 형제요소로 .area_left가 존재할 경우 if($(this).parent().find('.area_left').length > 0){ //.area_right 내부에 텍스트 요소(span.ico_notice)만 존재한다면 if($(this).find('span.ico_notice').length > 0 && $(this).children().length == 1){ $(this).css({"margin-top":"0"/*, 'border':'1px solid red'*/}); }else if($(this).find('.wrap_table').length > 0){ $(this).css({"margin-top":"0"/*, 'border':'1px solid red'*/}); }else if($(this).hasClass('btn_bbs')){ $(this).css({"margin-top":"0"/*, 'border':'1px solid red'*/}); }else{ $(this).css({"margin-top":"0"/*, 'border':'1px solid blue'*/}); } } }); } $("#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").not('.electricMuseum04 .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").not('.electricMuseum04 .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").not('.electricMuseum04 .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"); } }); /*전기박물관 영상자료 리스트 4개기준 마진값 초기화*/ $(".electricMuseum04 .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"); } }) /*전기박물관 디렉토리*/ $('.list_data>li dl dd.data_cont ul li a, .electricMuseum04 .gallery_list_box .gallery_list .thumb .thumbMask a').bind('mouseover focus', function(){ $(this).find('img').css({'opacity': '0.4'}); }) $('.list_data>li dl dd.data_cont ul li a, .electricMuseum04 .gallery_list_box .gallery_list .thumb .thumbMask a').bind('mouseleave blur', function(){ $(this).find('img').css({'opacity': '1'}); }) /*영상자료 리스트 5개 기준 마진값 초기화*/ $(".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"); } }); /* 게시판 리스트 상단에 코멘트 + 다른요소가 함께 올때 아래와 같이 구분 */ var objCommentDsc = $(".board_align .area_right > span"); var objIcoNotice = $("span.ico_notice"); objCommentDsc.each(function(){ if($(this).index() > 0){ $(this).parent().find(objIcoNotice).css({ "margin-right": "15px" }); $(this).parent().find(objIcoNotice).html('첨부파일 아이콘을 클릭하시면 다운로드 하실 수 있습니다.'); $(this).parent().find("span.ico_notice > .line").css({ "padding-right": "15px", "border-right": "1px solid #ddd" }); } }); /*box_info 하단에 바로 btn_bbs가 올때 마진값 재정의*/ var objBoxInfo = $('.box_info.type2'); if(objBoxInfo.next().hasClass('btn_bbs')){ objBoxInfo.next().css({'margin-top': '-10px'}); } /* 2013.05.01 | 김미선 | 페이징 다음에 담당자 정보박스가 올경우 마진값조정 */ var objPagingDiv = $('.paging'); if(objPagingDiv.next().hasClass('box_blue')){ objPagingDiv.css({'margin-bottom': '50px'}); } /*conSection 마지막 요소가 버튼이고, conSection 인접요소의 자식이 wrap_table일 경우*/ $('.conSection').each(function(){ var objBtnbbsLast = $(this).find('.btn_bbs').last(); var objWrapTable = $(this).find('>.wrap_table').last(); var objConSectionChild = objBtnbbsLast.parent().next().children(); var strClass = 'wrap_table' var objListEstoryWarpTable = $('.prGallery .wrap_table, .list_estory .wrap_table, .info_desc.box_field .wrap_table').last(); //지식센터 전기이야기 마지막 테이블 마진값 재조정 if(objConSectionChild.attr('class') == strClass){ $('.wrap_table').parent().prev().find('.btn_bbs').last().css({'margin-bottom': '-8px'}); } //$(".conSection>.wrap_table:last-child").css("margin-bottom","50px"); // 2013.04.24 | 김미선 | 하단 알림박스 스타일 정의 /* 2013.04.24 | 박현아 | conSection 안에 wrap_table 가 마지막으로 올 경우 margin-bottom:50px; */ if(objWrapTable.next().length == 0){ objWrapTable.not(objListEstoryWarpTable).css({'margin-bottom': '50px'}) }else{ objWrapTable.css({'margin-bottom': '0px'}) } }) /* PART : 전국사업소 지사리스트 2줄 이상일 경우 */ /*$(".office_lst .sub_layer > li").each(function(){ if(($(this).index()) % 8 == 0){ $(this).css({ "padding-left":"0px", "background":"none", "clear":"left" }); /* 한줄에 8개 li 기준으로 .office_lst 의 margin-bottom:72px 기준이며 두줄 이상이 될경우 25px씩 +되서 증가하면 됨. : 아래 함수 충돌이 나서 주석처리함 */ /*$(".office_lst").css({ "margin-bottom":"97px" });*/ /*} });*/ //전국사업소 지사리스트 텝메뉴 높이 조정 var objOfficeLst = $(".office_lst .sub_layer"); objOfficeLst.parents(".office_lst").css('margin-bottom', objOfficeLst.outerHeight() + parseInt(objOfficeLst.css("marginBottom")) + 10); /*기본 탭의 서브 리스트가 width 740px 을 넘어 갈때*/ var objTabLayer = $('.wrap_tab_sub .tab_layer>li'); var objTabLayerSub = $('.wrap_tab_sub .tab_layer>li .sub_layer li'); var intTabLayerSub = objTabLayerSub.outerWidth()*objTabLayerSub.length; var intTabLayerSubW = 0; objTabLayerSub.not($('.wrap_tab_sub.office_lst .tab_layer>li .sub_layer li')).each(function(index){ var intPositionLeft = objTabLayerSub.position(); intTabLayerSubW += objTabLayerSub.outerWidth(); if(intTabLayerSubW > 740){ objTabLayerSub.eq(index).css({"padding-left":"0px", "background":"none", "clear":"left"}); } }) /*리스트 3개기준으로 addClass bgnon */ 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) { subLink.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(); $(this).closest("li").find(">a").focus(); return false; }); //objListReservA.each(function(){ objListReservA.click(function(){ $('.list_reserv li, .td_cont.name li').css({'z-index': '0'}) $('.layer_cal').hide(); $(this).nextUntil('layer_cal').show(); $(this).parent().css({'z-index': '4'}) 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){ objButton.click(function(){ objLi.removeClass('on'); objImg.hide(); $(this).parent('li').addClass('on').find('img').show(); return false; }) //}) } /*탭*/ var tabLayerShowHide = function(){ var objH2Tab = $('h2.tab_tit>a'); var objH2TabParent = objH2Tab.parent(); var objH2TabParent2 = $('.wrap_tab.type1 h2 .wrap_tab.type2 h2, .wrap_tab.type3 h2, .wrap_tab.type4 h2, .reservStep01 h2 '); var objElectHeTab = $('.elect_museum_h h2 a, .reservation h2 a'); var objDlLayer = $('.reservLayer'); objH2Tab.each(function(index){ objDlLayer.hide(); if(objH2TabParent.hasClass('on')){ $('h2.on').next().show(); } $(this).click(function(){ objH2TabParent.removeClass('on').end().css({'border-right': 'none'}); $(this).parent().addClass('on').end().css({'border-right': '1px solid #1d1d1d'}); objElectHeTab.css({'border-right': 'none'}); if($(this).parent().parent().index() == 0){ objH2TabParent.eq(0).css({'border-left': 'none'}); } if(!objH2TabParent.eq(0).hasClass('on')){ objH2TabParent.not(objH2TabParent2).eq(0).css({'border-left': '1px solid #dddddd'}); objH2Tab.parent().last().css({'border-right': '1px solid #dddddd'}); objElectHeTab.css({'border-right': 'none'}); } if($(this).parent().parent().index() == objH2TabParent.parent().length - 1){ $(this).parent().css({'border-right': '1px solid #1d1d1d'}); }else{ objH2Tab.parent().last().css({'border-right': '1px solid #dddddd'}); } /*전기에너지관 탭*/ // wrapTabType1() 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; }); }) /*통합예약 달력예약 일자 클릭시 보더생성*/ $('.promotion .table_cal td .td_cont .day a.on').click(function(){ $('.promotion .list_reserv_btn').css({'border-top' :'1px solid #bedaed'}); $('.promotion .table_cal td .td_cont .day a.on').removeClass('reserv'); $(this).addClass('reserv'); }) /*전기퀴즈*/ /*var objCompleteQuiz = $('.complete_quiz'); var objBtnStep2 = $('.list_quiz_2'); var objBtnStep3 = $('.list_quiz_3'); objCompleteQuiz.hide(); 1단계 문제 완료 후 2단계 버튼 클릭시 퀴즈 활성화 objBtnStep2.click(function(){ 단계 활성화 objH2TabParent.removeClass('on'); objH2TabParent.eq(1).addClass('on'); 레이어 활성화 objDlLayer.hide(); objDlLayer.eq(1).show(); objCompleteQuiz.hide(); return false; }); 1단계 문제 완료 후 3단계 버튼 클릭시 퀴즈 활성화 objBtnStep3.click(function(){ 단계 활성화 objH2TabParent.removeClass('on'); objH2TabParent.eq(2).addClass('on'); 레이어 활성화 objDlLayer.hide(); objDlLayer.eq(2).show(); objCompleteQuiz.hide(); return false; });*/ } var tabLi = function(){ var objLi = $('.tab li'); var objLiA = $('.tab li a'); //objLiA.each(function(index){ objLiA.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(); /*홍보센터 SNS*/ prSnS(); /*회사소개 사회공헌 활동소식 배너 */ objNoticeContBanner(); } var prListFn = function(){ /*홍보센터 PR today list*/ var objTodayListli = $('.today_list li'); var objMonthlyList = $('.monthly_list li'); for(i=1 ; i') $('.bg_layer').css({'height': prGalleryLayerHeight + 'px', 'opacity': '0.9'}) //$('.pribhp002 .bg_layer').css({'height': prGalleryLayerHeight - 58 + 'px'}) var layer = $('.wrap_tab .tab_cont'); var tabTit = $('.wrap_tab .tab_tit a'); var currentTabCont = 0; layer.hide(); layer.eq(0).show(); tabTit.click(function(){ if($('#wrap').hasClass('electricPowerGal02')){ layer.hide(); $(this).parent().next(layer).show(); } if(currentTabCont != $(this).parent().parent().index()){ setVisibleObjectTag($('object'), currentTabCont); layer.hide(); $(this).parent().next(layer).show(); currentTabCont = $(this).parent().parent().index(); } }); /* 바닥페이지에 동영상플레이어가 있을 경우 */ var setVisibleObjectTag = function(objWmp, index){ if (objWmp.length == 0) return; if(detectBrowser().browser == 'Microsoft Internet Explorer'){ if(index == 1) { wm_player2.controls.stop(); }else if(index == 2) { wm_player4.controls.stop(); } }/*else{ if(index == 1) { wm_player.controls.stop(); }else if(index == 2) { wm_player3.controls.stop(); } }*/ } /*전기에너지관 탭*/ var tabTit = $('.conSection .tab_tit a'); var tabTitWidth = tabTit.outerWidth(); var tabTitHeight = tabTit.outerHeight(); tabTit.each(function(index){ if(index < 6){ tabTit.parent().eq(index).css({'left': (tabTitWidth * index) + 'px'}); }else { tabTit.parent().eq(index).css({'left': (tabTitWidth * (index - 6)) + 'px', 'top': tabTitHeight + 'px'}); }; }); /*탭이 두줄인 경우*/ var tabTit2 = $('.wrap_tab.type2 .conSection .tab_tit a'); var tabTit2Width = tabTit2.outerWidth(); var tabTit2Height = tabTit2.outerHeight(); tabTit2.each(function(index){ if(index < 5){ tabTit2.parent().eq(index).css({'left': (tabTit2Width * index) + 'px'}); }else { tabTit2.parent().eq(index).css({'left': (tabTit2Width * (index - 5)) + 'px', 'top': tabTit2Height + 'px'}); }; }); /*전기에너지관 탭*/ wrapTabType1(); var intDefinitionScbox = $('.definition .scbox').length for(i=2; i < intDefinitionScbox; i+=3){ $('.definition .scbox').eq(i).css({'margin-right': '0'}) } /*전기에너지관 관람안내*/ var imgView = $('.img_view li'); var thumbImg = $('.thumb img'); var thumbImgWidth = imgView.find('a').outerWidth(); var num = 0; var setAuto; var $controller = $(".img_viewbox .control, .img_viewbox_other .control"); imgView.find('img').not(thumbImg).hide(); $('.img_view li.on').find('img').show(); focusImg(); setPlay(); $controller.find(".btn_play").hide(); imgView.each(function(index){ thumbImg.parent().eq(index).css({'left': (thumbImgWidth * index) + (5 * (index + 1)) + 'px'}); $(this).click(function(e){ num = index; focusImg(); setStop(); setPlay(); e.preventDefault(); }) }); function focusImg() { var target = imgView.eq(num); var target_length = $('.img_view li').length; imgView.removeClass('on').find('img').not(thumbImg).hide(); $(target).addClass('on').find('img').show(); $('.img_view li a.thumb img').css({ "opacity":"0.2" }); $('.img_view li.on a.thumb img').animate({ "opacity":"1" }, 100); var target_id = $('.img_viewbox .img_view li.on').attr('id'); $('.img_viewbox .img_list li').removeClass('on'); $('.' + target_id).addClass('on'); num += 1; if(num >= target_length) num = 0; } function setPlay() { setAuto = setInterval(focusImg, 5000); } function setStop() { clearInterval(setAuto); } $controller.find(".btn_prev").on('click', function(e){ setStop(); num -= 2; focusImg(); $controller.find(".btn_play").show(); $controller.find(".btn_stop").hide(); e.preventDefault(); }); $controller.find(".btn_next").on('click', function(e){ setStop(); focusImg(); $controller.find(".btn_play").show(); $controller.find(".btn_stop").hide(); e.preventDefault(); }); $controller.find(".btn_stop").on('click', function(e){ setStop(); $controller.find(".btn_play").show(); $controller.find(".btn_stop").hide(); e.preventDefault(); }); $controller.find(".btn_play").on('click', function(e){ setPlay(); $controller.find(".btn_play").hide(); $controller.find(".btn_stop").show(); e.preventDefault(); }); $('.img_viewbox .img_list>ul>li').on('click', function(){ var img_data = $(this).attr('data-tab'); $('.img_viewbox .img_list>ul>li').removeClass('on'); $(this).addClass('on'); $('.img_viewbox .img_view li').removeClass('on'); $("#" + img_data).addClass('on'); }); /*전기에너지관 프로그램 안내*/ var layerType2 = $('.pribhp002 .tab_cont .layer .desc'); var layerThumbBtn = $('.layer .btn'); var layerThumbBtnA = layerThumbBtn.find('a') var layerThumbBtnWidth = $('.layer .btn').outerWidth(); layerType2.parent().not(layerType2.parent().eq(0)).hide(); /*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'}) } }) } /*전기에너지관 탭*/ 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(1).css({'left': (width0 - 1) + 'px'}); tabTitType1.eq(2).css({'left': (width0 + width1 - 2) + 'px'}); tabTitType1.eq(3).css({'left': (width0 + width1 + width2 - 3) + 'px'}); tabTitType1.eq(4).css({'left': (width0 + width1 + width2 + width3 - 4) + 'px'}); } /*타이들 밑에 주석같은 요소가 올때 마진값 재 조정*/ var titBottomReqM = function(){ $('.h2tit + .txt_table_info, .h3tit + .txt_table_info, .h2tit + .limit_num,.h2tit + .board_align, .h3tit + .board_align').not('.board_align.techPop').css({ 'margin-top': '-24px' }); $('.h2tit + .btn_file.btnR, .h3tit + .btn_file.btnR').css({ 'margin': '-42px 0 10px' }); $('.tr765Kv03 .h2tit + .btn_file.btnR').css({ 'margin': '-42px 0 17px' }); } /*테이블 보더값*/ 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 nCurrentIndex) showBannerAt(index, 1, 550); else showBannerAt(index, -1, 550); return false; }).on('mouseenter focusin',function(event){ if(loop) stopLoop(); }).on('mouseleave focusout',function(event){ if(loop) playLoop(); }); loopToggleBtn.on('click',function(){ var $img = $(this).find('img'); if(loop){ $img.attr({'src':'/kepco/front/img/pr/btn_play.png','alt':'재생 버튼'}); stopLoop(); loop = false; }else{ $img.attr({'src':'/kepco/front/img/pr/btn_pause.png','alt':'정지 버튼'}); playLoop(); } return false; }).on('focusin',function(event){ if(loop) stopLoop(); }).on('focusout',function(event){ if(loop) playLoop(); }); objCont.eq(5).find('a.goto').on('focusin',function(event){ if(loop) stopLoop(); objCont.eq(nCurrentIndex).css('top',-900); objThumbImg.eq(nCurrentIndex).css({'opacity': '0.6'}); objThumb.eq(nCurrentIndex).removeClass('on'); nCurrentIndex = 5; objCont.eq(nCurrentIndex).css('top',0); objThumb.eq(nCurrentIndex).find('img').css({'opacity': '1'}); objThumb.eq(nCurrentIndex).addClass('on'); }).on('focusout',function(event){ if(loop) playLoop(); }); //인터벌 function playLoop(){ if(nTimerID > 0) return; if(total > 1) { nTimerID = setInterval(startPlayNext, interval); loop = true; } } function stopLoop(){ if(loop){ clearInterval(nTimerID); nTimerID = 0; } } //다음 배너 설정 function startPlayNext(){ if(total <= 1) return; if(nCurrentIndex >= total - 1) showBannerAt(0, 1, 900); else showBannerAt(nCurrentIndex+1, 1, 900); } // nIndex에 해당하는 비주얼을 활성화시킴. function showBannerAt(nIndex, dir, speed){ if(nIndex == nCurrentIndex) return; if(!$('.wrapper .wrap_cont').is(':animated')){ //썸네일 활성화 objThumbImg.css({'opacity': '0.6'}); objThumb.eq(nIndex).find('img').css({'opacity': '1'}); objThumb.removeClass('on'); objThumb.eq(nIndex).addClass('on'); //이전비주얼 비활성화/현재비주얼 활성화 $('.wrapper .wrap_cont').eq(nCurrentIndex).stop(true, false).animate({'top':-900*dir}, speed, 'easeInOutQuad'); $('.wrapper .wrap_cont').eq(nIndex).stop(true, false).css('top',(900*dir)).animate({'top':0}, speed, 'easeInOutQuad'); // 현재비주얼 index값을 업데이트 시켜준다. nCurrentIndex = nIndex; } } } /*PR SNS*/ var prSnS = function(){ var objTabSns = $('.tab_sns li a') ; var objSnsView = $('.sns_view'); // objSnsView.not(':eq(0)').hide(); objSnsView.not(':eq(0)').css("display","none"); objTabSns.each(function(index){ $(this).on("click focus", function(){ if(index != 2 && index != 3 && index != 4 && index != 5){ var imgSrcOn = $(this).find('img').attr('src').replace('.png', "_on.png"); // $(".sns_cont").find("a:first").focus(); //objSnsView.hide(); //objSnsView.eq(index).show(); objSnsView.css("display","none"); objSnsView.eq(index).css("display","block"); if(!$(this).parent().hasClass('on')){ /*모든 이미지 초기화*/ objTabSns.find('img').each(function(){ var imgSrc = $(this).attr('src').replace('_on.png', ".png"); $(this).attr('src', imgSrc); }) objTabSns.parent().removeClass('on'); /*해당 탭 활성화 및 이미지 변경*/ $(this).parent().addClass('on').end().find('img').attr('src', imgSrcOn); } return false; } }) }) } /*회사소개 사회공헌 활동소식 배너 */ var objNoticeContBanner = function(){ var objNoticeContBtn = $('.notice_box .notice_cont .right .box .btn'); objNoticeContBtn.click(function(){ objNoticeContBtn.prev().hide(); $(this).prev().show(); objNoticeContBtn.parent().removeClass('on'); $(this).parent().addClass('on'); }); }; /* 지식센터 전기계산기 */ $(document).ready(function(){ var objPayExpListA = $(".payExp .payExp_list tr td a"); var objPayExpCon = $('.payExpCon'); objPayExpCon.eq(0).show(); objPayExpListA.each(function(index){ $(this).click(function(){ objPayExpCon.hide(); objPayExpCon.eq(index).show(); objPayExpListA.removeClass('on'); $(this).addClass('on'); }); }); }); /*전기박물관*/