$(function() { $(".header_menu a").hover(function(){ if($(this).hasClass("active")){return false;} $(this).find("img").attr("src", $(this).find("img").attr("src").replace(".png", "_on.png")); },function(){ if($(this).hasClass("active")){return false;} $(this).find("img").attr("src", $(this).find("img").attr("src").replace("_on.png", ".png")); }) }); $(function(){ //메인 주 메뉴 $('.menu_wrap ul li a.m_1depth').hover(sub_show, sub_hide); $('.menu_wrap ul li a.m_1depth').focus(sub_show2); $('.menu_wrap ul li a.m_1depth').blur(sub_hide3); if($('.menu_wrap ul li').is('.menu06')) { $('.menu_wrap ul li.menu06 a.m_1depth').next('.m_2depth').find('ul li:last-child a').blur(sub_hide2); }; function sub_show(){ $('.m_2depth').not($(this).next()).hide(); $(this).next('.m_2depth').show(); $(this).parent('li').parent('ul').find('a').removeClass('on'); $(this).next('.m_2depth').hover( function(){ $(this).show(); $(this).prev().addClass('on'); }, function(){ $('.m_2depth').hide(); $(this).prev().removeClass('on'); $(this).parents('.menu_wrap').removeClass('on'); } ); }; function sub_hide(){ $(this).next('.m_2depth').hide(); $(this).parents('.menu_wrap').removeClass('on'); }; function sub_show2(){ $('.m_2depth').hide(); $(this).next('.m_2depth').show(); $('.m_1depth').not($(this)).removeClass('on'); $(this).addClass('on'); }; function sub_hide3(){ $('.m_2depth').not($(this).next('.m_2depth')).hide(); }; function sub_hide2(){ $(this).parents('.m_2depth').hide(); $(this).parents('.m_2depth').prev().removeClass('on'); }; //메인 탭 $('.tab_wrap').find('li:first-child .btn_tab').addClass('on'); $('.tab_wrap').find('li:first-child .btn_tab').next('div').show(); $('.btn_tab').click(function(){ $(this).parents('ul').find('.btn_tab.on').next('div').hide(); $(this).parents('ul').find('.btn_tab.on').removeClass('on'); $(this).next('div').show(); $(this).addClass('on'); return false; }); }); $(function(){ $(".btn_allmenu").bind("click",function(){ $(".view_all").toggle(); }); $(".btn_closemenu").bind("click",function(){ $(".view_all").hide(); }); $(".select_language_btn").bind("click",function(){ $(".select_language ul").toggle(); }); $(".select_language ul li:last-child a").bind("focusout",function(){ $(".select_language ul").hide(); }); $(".select_language ul li a").bind("click",function(){ $(".selected_language").html($(this).clone()).next().hide(); }); $(".btn_google").bind("click",function(){ $(".google_section").toggle(); }); $(".btn_google_close").bind("click",function(){ $(".google_section").hide(); }); }); $(function(){ $(".over_con ul li a").bind("click mouseenter focusin",function(){ $(this).addClass('on'); }); $(".over_con ul li a").bind("mouseleave focusout",function(){ $(this).removeClass('on'); }); }); $(function(){ $(".go_top > a").click(function(){ $('html, body').animate({scrollTop : 0},300); return false; }) }); $(function(){ $(".inbox .list_con").click(function(){ $(".list_con").removeClass("active"); $(this).addClass("active"); $(".inbox .view > td").removeClass("m_on").addClass("m_off"); $(this).next().find(">td").removeClass("m_off").addClass("m_on"); return false; }); }); //숫자만 입력하게 하기 function FT_ONLY_NUMBER(el){ el.value = el.value.replace(/\D/g,''); }