$(function(){ //GNB $('.header .gnb > ul > li').on("mouseenter focusin", function(){ //$('.header .gnb > ul > li').removeClass('on'); $('.header .gnb > ul > li').addClass('on'); $('.gnbBgbDim').stop(true,true).animate({"height":"257px"},100); }) $('.header .nav').on("mouseleave", function(){ $('.header .gnb > ul').find('li').removeClass('on'); $('.gnbBgbDim').stop(true,true).animate({"height":"0px"},100); }) $('.header .gnb > ul > li:last-child .twoDepthBox ul > li:last-child').on("keydown", function(e){ if(!e.shiftKey && e.keyCode == 9) $('.header .gnb > ul > li').removeClass('on'); $('.gnbBgbDim').stop(true,true).animate({"height":"0px"},100); }) $('.header .gnb > ul > li > a').on("keydown",function(e){ if(e.shiftKey && e.keyCode == 9) { $this = $(this) //$this.parent().removeClass('on') $i = $this.parent().index() if($i){ $li = $('.header .gnb > ul > li').eq($i-1) $li.addClass('on') $li.find('li').last().focus() } } }) $('.header .gnb ul > li.menu01 a.oneDepth').on("keydown",function(e){ if(e.shiftKey && e.keyCode == 9) { $('.gnbBgbDim').stop(true,true).animate({"height":"0px"},100); $('.header .gnb > ul > li').removeClass('on'); } }) $('.mainVisualArea').on("keydown",function(e){ if(e.shiftKey && e.keyCode == 9) { $li = $('.header .gnb > ul > li').last() $li.addClass('on') $li.find('li').last().focus() } }) //faq $(".question .q_tit").click(function() { $(".question").removeClass("on"); $(".question .q_tit").removeClass("on"); $(".aswer").slideUp("fast"); if (!$(this).parent().next(".aswer").is(":visible")) { $(this).parent().next(".aswer").slideDown(); $(this).addClass("on"); $(this).parent().addClass("on"); } }); //홍보관 안내 $(".layrThumbImg").fancybox({ helpers: { title : { type : 'outside' }, overlay : { speedOut : 0 } } }); }); //lnb function lnbMenu(depth1,depth2){ $('.lnb .lnbList li a').bind('focusin mouseenter',function() { $(this).addClass('on'); $(this).parent().siblings().find('a').removeClass('on'); }); $('.lnb .lnbList').bind('mouseleave',function() { $(this).children('li').find('ul').css('display', 'none'); $(this).children('li').find('a').removeClass('on'); $('.lnb .lnbList > li:eq('+depth1+') > a').addClass('on') $('.lnb .lnbList > li:eq('+depth1+') > a').parent().find('ul').css('display', 'block'); $('.lnb .lnbList > li:eq('+depth1+') ul li:eq('+depth2+') > a').addClass('on') }); if ( $('.lnb .lnbList > li').size() > depth1){ $('.lnb .lnbList > li:eq('+depth1+') > a').addClass('on') $('.lnb .lnbList > li:eq('+depth1+') > a').parent().find('ul').css('display', 'block'); $('.lnb .lnbList > li:eq('+depth1+') ul li:eq('+depth2+') > a').addClass('on') } $('.lnb .lnbList li:last-child ul li:last-child a').bind('focusout',function() { $(this).parents('.lnbList ul').css('display', 'none'); $(this).parents('.lnb .lnbList li').find('a').removeClass('on'); $('.lnb .lnbList > li:eq('+depth1+') > a').addClass('on') $('.lnb .lnbList > li:eq('+depth1+') > a').parent().find('ul').css('display', 'block'); $('.lnb .lnbList > li:eq('+depth1+') ul li:eq('+depth2+') > a').addClass('on') }); } //패밀리사이트 function goto_url(fid, targ, opt) { var obj = document.getElementById(fid); var url = obj.options[obj.selectedIndex].value; if(!url) { alert('이동하실 목록을 선택해주세요'); } else if(targ) { window.open(url, targ, opt); } else { location.href = url; } } //tab $(function(){ $('.tabZone li a').on('click',function(e){ e.preventDefault(); var idx = $(this).parent().index(); $('.tabView > .detail').hide(); $('.tabView > .detail').eq(idx).fadeIn(); $('.tabZone li').removeClass('on'); $(this).parent().addClass('on'); }) })