var mobileNav = { init: function() { this.moAction(); }, moAction: function() { var depth_1 = $('.gnb_mobile .depth01'); var depth_2 = $('.gnb_mobile .depth02'); var nav_close = $('.btn_nav_off'); var mo_nav_bg = $('.mo_nav_bg'); $(depth_2).hide(); $(mo_nav_bg).hide(); $(depth_1).each(function() { if ($(this).children("ul").hasClass("depth02")) { $(this).children('a').click(function() { if ($(this).next('.depth02').css('display') === 'none') { $(depth_1).children('a').removeClass('selected1'); $(this).addClass('selected1'); $(depth_2).slideUp(200); $(this).next().stop().slideDown(200); } else { $(this).next('.depth02').slideUp(200); $(depth_1).children('a').removeClass('selected1'); } return false; }); } else { $(this).find('a').addClass('no'); } }); $('.btn_nav').on('click', function() { if ($('.gnb_mobile').hasClass('on') === false) { $('.gnb_mobile').addClass('on'); $(mo_nav_bg).fadeIn(300); $('html,body').addClass('fix'); $(this).addClass('on'); } else { $(this).removeClass('on'); $('.gnb_mobile').removeClass('on'); $('html,body').removeClass('fix'); $(mo_nav_bg).fadeOut(100); $(depth_2).hide(); $(depth_1).children('a').removeClass('selected1'); } }); $(nav_close).on('click', function() { $('.gnb_mobile').removeClass('on'); $('html,body').removeClass('fix'); $(mo_nav_bg).fadeOut(100); $(depth_2).hide(); $(depth_1).children('a').removeClass('selected1'); }); } }; function headerFix() { if ($(window).scrollTop() > 1) { $('#header').addClass('scroll'); } else { $('#header').removeClass('scroll'); } }; $(window).on('scroll', function() { headerFix(); }); $(document).on('ready', function() { mobileNav.init(); wowrap.init(); scrolltop(); magnificPop.init(); headerFix(); }); var magnificPop = { init: function() { this.pop_01(); }, pop_01: function() { $('.popup_link').magnificPopup({ type: 'ajax', closeOnBgClick: false, }, 500); $('.popup_inline').magnificPopup({ type: 'inline', closeOnBgClick: false, }, 500); } } function closePopup() { $.magnificPopup.close(); } function scrolltop() { var scrolltop = $(".scrolltop") scrolltop.mCustomScrollbar({ theme: "" }); } var wowrap = $('.wowrap'); $(wowrap).each(function() { $(this).find('.wow').each(function(index) { var eq = (index) / 4 + "s"; $(this).attr('data-wow-delay', eq); }); $(this).find('.animated').each(function(index) { var eq = (index) * 250; $(this).attr('data-id', 'delay-' + eq); }); }); $(document).ready(function() { var $slick_carousel = $(".visual-con"); $slick_carousel.on('init', function(event, slick) { $(".visual-item").eq(0).addClass("active-item"); }); $slick_carousel.on('afterChange', function(event, slick, currentSlide) { $(".visual-item").removeClass("active-item"); $(this).find(".visual-item").eq(currentSlide).addClass("active-item") }); $('.visual-con').slick({ infinite: true, slidesToShow: 1, slidesToScroll: 1, autoplay: true, arrows: true, dots: true, fade: true, prevArrow: '', nextArrow: '', autoplaySpeed: 4000, speed: 2000, easing: 'easeInOutQuint', pauseOnHover: false }); }); // Product Slider $('.product-slider-active').slick({ dots: true, infinite: true, speed: 300, slidesToShow: 4, slidesToScroll: 1, autoplay: true, arrows: false, prevArrow: '', nextArrow: '', focusOnSelect: true, centerMode: true, responsive: [{ breakpoint: 991, settings: { slidesToShow: 3, centerMode: false, } }, { breakpoint: 768, settings: { slidesToShow: 2, centerMode: false, } }, { breakpoint: 480, settings: { slidesToShow: 1, centerMode: false, } } ] });