/* * Name: KEPCO * Part: JavaScript for design * Author : [써냐]BLUEWEBD™ */ /* design for CSS*/ $(document).ready(function() { colRowSpanBorder(); // colspan, rowspan border 제어 titBottomReqM();// 제목 하단 문구 나올때 여백조정 //utilWidth(); // util 바로가기 영역 넓이에 따라 위치값조정 $(".class").css({ "background":"#000", "opacity":"0.7" }); /* 이미지 갤러리 미리보기 리스트 이미지 오버효과 */ var thumbOj = $('.thumbMask'); var thumbMask = $('.thumbMask img'); thumbOj.each(function() { $(this).hover(function(){ $(this).css({ "height":"100%", "background":"#000" }); $(this).find('img').css({ "opacity":"0.5" }); },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"); // $("#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"); } }); // 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"); } }); var objConSection = $('.conSection'); var objPopConSection = $('#popBody>.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') }); }); /*탭*/ tabLayer(); }); 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'); $(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 titBottomReqM = function(){ $('.h2tit + .txt_table_info, .h3tit + .txt_table_info, .h2tit + .limit_num').css({ 'margin-top': '-24px' }); $('.h2tit + .btn_file, .h3tit + .btn_file').css({ 'margin': '-36px 0 9px' }); } var colRowSpanBorder = function(){ $('th[scope=rowgroup]').not($('#popBody th[scope=rowgroup]')).css('border-right', '1px dotted #c9c9c9'); $('th.lineL, td.lineL').css({'border-left': '1px solid #b3d2e9'}); $('th.lineR, td.lineR').css({'border-right': '1px solid #b3d2e9'}); } var tabLayer = function(){ var layer = $('.wrap_tab .tab_cont'); var tabTit = $('.wrap_tab .tab_tit a'); layer.hide(); layer.eq(0).show(); tabTit.each(function(){ $(this).click(function(){ tabTit.parent().removeClass('on'); layer.hide(); $(this).parent().next(layer).show().end().addClass('on'); }); }); var tabTitType1 = $('.wrap_tab .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 + 3 + 'px'}); tabTitType1.eq(2).css({'left': (width0 + width1 + 6) + 'px'}); tabTitType1.eq(3).css({'left': (width0 + width1 + width2 + 9 ) + 'px'}); tabTitType1.eq(4).css({'left': (width0 + width1 + width2 + width3 + 12 ) + 'px'}); } var utilWidth = function(){ var objUtil = $('#header .util'); var objSelSelect = $('#header .kepco_home .dyn_selSelect li'); objSelSelect.eq(1).click(function(){ objUtil.css({'right': '73px'}) }) objSelSelect.not(':eq(1)').click(function(){ objUtil.css({'right': '63px'}) }) }