$(function(){ var scrolltopvalue; $(window).scroll(function(){ scrolltopvalue = $(window).scrolltop(); if($(document).scrolltop()>=100) { $('header .head-pc').addclass('on'); $('#mb-header #navbar-main').addclass('on'); }else { $('header .head-pc').removeclass('on'); $('#mb-header #navbar-main').removeclass('on'); } }) var height = $('header .head-pc').offset().top; if(height>=100) { if($(document).scrolltop()>=100) { $('header .head-pc').addclass('on'); }else { $('header .head-pc').removeclass('on'); } } $('.head-pc .li-1').mouseenter(function () { $(this).children('.subnav').stop(true,false).slidedown(300); }); $('.head-pc .li-1').mouseleave(function () { $(this).children('.subnav').stop(true,false).slideup(300); }); $('.head-pc .subnav a,.foot-t dd a,.banner .scrolldown').on('click',function(e){ var winwidth = $(window).width(); var height; winwidth < 1024 ? height = 50 : height = 78; var hash = $(this).attr("href").split("#")[1]; if(hash && jquery("#" + hash).length >= 1) { e.preventdefault(); $("html, body").animate({ scrolltop: jquery("#" + hash).offset().top - height }, 600); } }) $('#mb-header #sidebar-main-trigger').on('click',function(){ if($(this).hasclass('active')){ $(this).removeclass('active'); $('#mb-header #sidebar-main').removeclass('open'); }else { $(this).addclass('active'); $('#mb-header #sidebar-main').addclass('open'); } }) $("#mb-header .mb-ej-li").on('click',function (e) { if ($(this).hasclass("mb-active")) { $(this).removeclass("mb-active").siblings('.has-child').removeclass('mb-active'); $(this).find(".mb-ej-ul").slideup(500) } else { $(this).addclass("mb-active").siblings('.has-child').removeclass('mb-active'); $(this).find(".mb-ej-ul").slidedown(500).parent('.has-child').siblings('.has-child').find('.mb-ej-ul').slideup(500); $('#mb-header .mb-ej-li.mb-active .ej-li a').on('click',function(e){ var height = 50; var hash = $(this).attr("href").split("#")[1]; if(hash && jquery("#" + hash).length >= 1) { jquery("html,body").animate({ scrolltop: jquery("#" + hash).offset().top - height }, 600); } $('#mb-header #sidebar-main-trigger').removeclass('active'); $('#mb-header #sidebar-main').removeclass('open'); }) } }); $('.slidermenu .menu').on('click',function(){ $('.submenu').addclass('show'); $("body").addclass("show"); }) $('.submenu .closed').on('click',function(){ $('.submenu').removeclass('show'); $("body").removeclass("show"); }) $('.footr .link .blogroll').click(function(){ $(this).siblings('ul').slidedown(300); }) $('.footr .link').mouseleave(function(){ $(this).children('ul').slideup(300); }) wow = new wow( { animateclass: 'animated', offset: 30, mobile: true, } ); wow.init(); }) $(window).on('load', function () { var winwidth = $(window).width(); var height; winwidth < 1024 ? height = 50 : height = 78; var hash = location.href.split("#")[1]; if (hash) { $("html, body").animate({ scrolltop: jquery("#" + hash).offset().top - height }, 600); } });