$(function(){ startJS(); menuJS(); }); function startJS() { $(document).on('click', 'a[href="#none"]', function(e) {e.preventDefault()}); WebFont.load({google: {families: ['Noto Sans KR', 'Montserrat']}}); if($('html').is('.ie67, .ie7, .ie8')) { $('div.ie_alert_text').show().html('현재 사이트는 IE8 이하의 하위브라우저를 지원하지 않습니다.
브라우저를 최신 버전으로 업데이트해 주세요.'); } (function inView() { var $animation_elements = $('.a_'); var $window = $(window); function check_if_in_view() { var window_height = $window.height(); var window_top_position = $window.scrollTop(); var window_bottom_position = (window_top_position + window_height); $.each($animation_elements, function() { var $element = $(this); var element_height = $element.outerHeight(); var element_top_position = $element.offset().top+100; var element_bottom_position = (element_top_position + element_height); //console.log(element_top_position); //check to see if this current container is within viewport if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) { $element.addClass('in-view'); } else { //$element.removeClass('in-view'); } }); } $window.on('scroll resize', check_if_in_view); $window.trigger('scroll'); }()); $('.foot_select_site h2').on('click', function(){ $('.foot_select_site ul.list').stop().slideToggle(450); $(this).toggleClass('on'); }); $('header li.language > a').on('click', function(){ $('header .lang_l').slideToggle(); }); $(document).ready(function() { $(window).on('scroll', function() { if (300 < $(window).scrollTop()) { $('#top_btn').fadeIn(); } else{ $('#top_btn').hide(); } }); }); $('#top_btn').click(function() { $('html, body').animate({ scrollTop: 0 }, 1500, 'easeOutExpo'); return false; }); function checkOffset() { var a=$(document).height()-$(window).height(); var b=$('footer').height(); scroll = $(window).scrollTop(); if (scroll > a-b) { $("#top_btn").removeClass(); $("#top_btn").addClass("absolute"); } else { $("#top_btn").removeClass(); $("#top_btn").addClass("fixed"); } } $(document).ready(checkOffset); $(document).scroll(checkOffset); } function menuJS () { $('.all_country_btn').on('click', function(){ $(".m_country").stop(true).slideToggle(); }); $('.all_nav_btn.pc_br').on('click', function(){ $('header').stop(true).toggleClass('open'); $(this).find('.menu-trigger').stop(true).toggleClass('active'); }); $('.all_nav_btn.tm_br').on('click', function(){ $(this).find('.menu-trigger').stop(true).toggleClass('active'); $(".m_menu").stop(true).slideToggle(); }); $('.m_menu .open_nav > li > a').on('click', function(){ $(this).parent().toggleClass('on').siblings().removeClass('on'); $(this).parent().find('div').stop(true).slideToggle(); $(this).parent().siblings().find('div').stop(true).slideUp(); }); $('.main_nav li').on('mouseenter', function(){ $('header').addClass('bg'); }).on('mouseleave', function(){ $('header').removeClass('bg'); }); }