$(function() { page.init(); }); var page = { init: function() { //���� page.common(); }, common: function() { //bg cover $(".bg_cover > .bg_img").each(function() { $(this).parent().css("background-image","url(" + $(this).attr("src") + ")"); }); //gnb hover var gnbHeader = $("#header .header_main"); $("#gnb").hover( function() { gnbHeader.addClass("active").stop(true,true).animate({ height:280 }, 200); }, function() { gnbHeader.stop(true,true).animate({ height:88}, 200, function() { $(this).removeClass("active"); }); } ); $("#gnb .menu").hover( function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); } ); //gnb mobile �޴� var headerGnbWrap = $("#header .gnb_wrap"); var headerGnb = $("#gnb"); $("#header .btn_menu").on("click", function() { headerGnbWrap.stop(true,true).css("opacity",0).show().animate({ opacity:1 }, 200); headerGnb.stop(true,true).animate({ right:0 },200); return false; }); var headerClose = $("#header .btn_close").on("click", function() { headerGnbWrap.stop(true,true).animate({ opacity:0 }, 200, function() { $(this).hide(); }); headerGnb.stop(true,true).animate({ right:-270 },200); return false; }); $("#gnb .link").on("click", function() { if(headerClose.is(":visible")) { var getMenu = $(this).parent(); if(getMenu.hasClass("active")) { getMenu.removeClass("active").find(".sub_menu").stop(true,true).slideUp(200); } else { $("#gnb .menu.active").removeClass("active").find(".sub_menu").stop(true,true).slideUp(200); getMenu.addClass("active").find(".sub_menu").stop(true,true).slideDown(200); } return false; } }); } } $(document).ready(function(){ $(".click-function li a[href *= sub]").on('click', function(e) { e.preventDefault(); var target = $(this).attr('href'); $('html, body').animate({ scrollTop: ($(target).offset().top) }, 500); }); }) $(function(){ $(".business-menu-slide > span").click(function(){ if($(this).next('ul').hasClass('on') == true){ $(this).next('ul').slideDown(); $(this).next('ul').removeClass('on'); $(this).addClass('active'); }else{ $(this).next('ul').slideUp(); $(this).next('ul').addClass('on'); $(this).removeClass('active'); } }) })