$(function(){ var shrinkHeader = 300; var subFixedHeader = 553; /*시작시 스크롤바 위치 한번 읽고 시작 (Gnb, Snb)*/ if(getCurrentScroll() >= shrinkHeader){ $('#header').addClass('shrink'); }else{ $('#header').removeClass('shrink'); } if(getCurrentScroll() >= subFixedHeader){ $('#sub-fixed').addClass('_fixed'); $('.sub_visual').addClass('_sub-fixed'); }else{ $('#sub-fixed').removeClass('_fixed'); $('.sub_visual').removeClass('_sub-fixed'); } $(window).scroll(function(){ var scroll = getCurrentScroll(); if(scroll >= shrinkHeader){ $('#header').addClass('shrink'); }else{ $('#header').removeClass('shrink'); } if(scroll >= subFixedHeader){ $('#sub-fixed').addClass('_fixed'); $('.sub_visual').addClass('_sub-fixed'); $('.snb:before').css('left', '66.66%'); }else{ $('#sub-fixed').removeClass('_fixed'); $('.sub_visual').removeClass('_sub-fixed'); } }); function getCurrentScroll() { return window.pageYOffset || document.documentElement.scrollTop; } AOS.init({ easing: 'ease-out-back', duration: 1000, }); $(".btn-lang").on('click',function(){ $(this).parents().toggleClass('active'); $(this).siblings().slideToggle(); }); $(".btn-scroll").on('click',function(){ var obj = $(this).attr('href') $('html,body').animate({ scrollTop: $(obj).offset().top}, 'slow'); }); $(".toggle-mnu").click(function() { $('#header').toggleClass("on"); $(".main-mnu").slideToggle(); return false; }); /* asdf */ $(document).ready(function() { var scrollLink = $('.scroll'); // Smooth scrolling scrollLink.click(function(e) { e.preventDefault(); $('body,html').animate({ scrollTop: $(this.hash).offset().top - 200 }, 1000 ); }); // Active link switching $(window).scroll(function() { var scrollbarLocation = $(this).scrollTop(); scrollLink.each(function() { var sectionOffset = $(this.hash).offset().top - 210; if ( sectionOffset <= scrollbarLocation ) { $(this).parent().addClass('active'); $(this).parent().siblings().removeClass('active'); } }) }); $(".js-hover").on("mouseover", function(){ $(this).find("input, textarea").css("background-color", "#fafafa"); $(this).find("input, textarea").css("border-left", "1px solid #a8a8a8"); }); $(".js-hover").on("mouseleave", function(){ $(this).find("input, textarea").css("background-color", "initial"); $(this).find("input, textarea").css("border-left", "initial"); }); }) });