$(document).on("scroll", function() { if($(document).scrollTop()>100) { $("header").removeClass("large").addClass("small"); } else { $("header").removeClass("small").addClass("large"); } }); (function($){ $.fn.dropdown = function(){ return this.each(function(){ var $gnb = $(this), $menu = $gnb.find(".menu"), $depth1 = $gnb.find(".depth1"), $depth2 = $gnb.find(".depth2"); $gnb.mouseenter(function(){ gnbOn(); }).mouseleave(function(){ gnbOff(); }); $gnb.find("a").focusin(function(){ gnbOn(); }).focusout(function(){ gnbOff(); }); function gnbOn(){ $gnb.find($depth2).stop().animate({height: "850"});/*서브메뉴 높이 조절*/ } function gnbOff(){ $gnb.find($depth2).stop().animate({height: "0"}); } }); } })(jQuery); if (matchMedia("screen and (min-width: 1024px)").matches) { $(function(){ $(".dropdown").dropdown(); }); } else { $(function(){ }); } $(function() { var model_1 = $('.gnb .depth2 .depth2_wrapper #menu_1 a'), model_2 = $('.gnb .depth2 .depth2_wrapper #menu_2 a'), model_3 = $('.gnb .depth2 .depth2_wrapper #menu_3 a'), model_4 = $('.gnb .depth2 .depth2_wrapper #menu_4 a'); model_1.click(function(){ $("#menu1_sub1").show(); $("#menu1_sub2").show(); $("#menu1_sub3").show(); $("#menu1_sub4").show(); $("#menu1_sub5").show(); $("#menu1_sub6").show(); }) model_2.click(function(){ $("#menu1_sub1").show(); $("#menu1_sub2").show(); $("#menu1_sub3").show(); $("#menu1_sub4").show(); $("#menu1_sub5").hide(); $("#menu1_sub6").hide(); }) model_3.click(function(){ $("#menu1_sub1").hide(); $("#menu1_sub2").hide(); $("#menu1_sub3").hide(); $("#menu1_sub4").hide(); $("#menu1_sub5").show(); $("#menu1_sub6").hide(); }) model_4.click(function(){ $("#menu1_sub1").hide(); $("#menu1_sub2").hide(); $("#menu1_sub3").hide(); $("#menu1_sub4").hide(); $("#menu1_sub5").hide(); $("#menu1_sub6").show(); }) }); /*전체메뉴*/ $('#toggle').click(function() { $(this).toggleClass('active'); $('#gnb').toggleClass('open'); }); /*$('.dropdown').hover(function() { $('#logo').toggleClass('logo_on'); }); $('.dropdown').hover(function() { $('aside.util').toggleClass('util_on'); });*/