fontSize(); $(window).resize(function () { fontSize(); }); function fontSize() { var size; var winW = $(window).width(); if (winW <= 1600 && winW > 1024) { size = Math.round(winW / 16); } else if (winW <= 1024) { size = 90; } else { size = 100; } $('html').css({ 'font-size': size + 'px' }) } $(function(){ setTimeout(function(){ $('#loading').fadeOut(400); AOS.init({ offset: 50, duration: 1100, disable: 'mobile', }); }, 300); headScroll() function headScroll() { var topVal = 0; var $header = $('.header'); topVal = $(window).scrollTop(); if(topVal > $('.header').height()) { $header.addClass('scroll'); }else { $header.removeClass('scroll'); } } $(window).scroll(function() { headScroll() }); $('.sim-select').hover(function() { $(this).children('ul').stop().slideDown(); }, function() { $(this).children('ul').stop().slideUp(); }); var $mask = $('#mask'); var $searBtn = $('.search-btn'); var $close = $('#mask .close'); var $nav = $('.mobile-box'); $searBtn.on('click', function () { $mask.addClass('show'); $('html').removeClass('overflow'); }); $close.on('click', function () { $mask.removeClass('show'); }); var $navBtn = $('.nav-btn'); $navBtn.on('click', function() { $navBtn.toggleClass('close'); $nav.toggleClass('show'); $('.header').toggleClass('mobile-show'); $('html').toggleClass('overflow'); }); $('.mobile-box .nav li .icon').on('click', function() { $(this).toggleClass('close').siblings('.sub-nav').slideToggle(350); }); var $msNav = $('.sidebar .sub-nav'); $('.sidebar h3 i').on('click', function() { $msNav.slideToggle(250); $(this).parent().toggleClass('down'); }); $('.sidebar .sub-nav .down').on('click', function() { $(this).toggleClass('close'); $(this).siblings('.lv3').slideToggle(250); }); })