(function ($) { $(function(){ $("#header .cate_m").clone().appendTo("#asi .asi_left") $("#header .head_middle ul.main_m>li").hover(function(){ $(this).find("ul.sub_m").stop().fadeToggle() },function(){ $("#header .head_middle ul.sub_m").hide() }) // header mouse hover - > sub m show let toggle = false; $("#header .ham a").click(function (e) { e.preventDefault(); if (toggle == false) { $(this).addClass("active-1") $("#asi").addClass("show1") setTimeout(function () { $("#asi").addClass("show2") }, 90) toggle = true; } else { $(this).removeClass("active-1") $("#asi").removeClass("show2") setTimeout(function () { $("#asi").removeClass("show1") }, 500) toggle = false; } }) //ham click -> asi show/hide $("#asi .main_m>li").each(function(i){ $(this).css({"transition-delay" : `${0.04*i}s`}) }) // aside menu slide animation $("#asi .asi_close").click(function (e) { $("#header .ham a").removeClass("active-1") toggle = false; e.preventDefault(); $("#asi").removeClass("show2") setTimeout(function () { $("#asi").removeClass("show1") }, 500) }) //asi close a click -> asi hide const BANNER_CLOSE_STATE = sessionStorage.getItem("IS_BANNER_CLOSED") if (!BANNER_CLOSE_STATE) { $(".top_banner").show() } //top banner show // top banner click - > hide $(window).scroll(function () { const WST = $(this).scrollTop() if (WST > 100) { $("#fix_icon").addClass("show") } else { $("#fix_icon").removeClass("show") } }) $("li.gotoTop a").click(function (e) { e.preventDefault(); $("html, body").animate({ scrollTop: '0' }, 1000); }) //gototop $("li.gotoBtm a").click(function (e) { e.preventDefault(); $("html,body").animate({ scrollTop: $(this.hash).offset().top }, 900); }) // 검색창 여닫기 jQuery(".btn_sch").click(function() { jQuery('.searchArea').slideToggle(); }); jQuery(".btn_sch_close a").click(function() { jQuery('.searchArea').slideUp(); }); // 검색어 문구 셋팅 jQuery( '.MS_search_word' ).attr( 'placeholder', '검색어를 입력해 주세요.' ); var _right_width = $('.all-finder-layer .finder-body').outerWidth() + 'px'; $('.all-finder-layer .finder-body').css('right', '-' + _right_width); // 다찾다 레이어 열기/닫기 $('#allfinder-ctr a').on('click', function(e) { e.preventDefault(); $(this).toggleClass('open'); if ($(this).hasClass('open')) { $('.all-finder-layer .finder-body').show(); $('.all-finder-layer .finder-body').stop(true, true).animate({ right: 0 }, 500); } else { $('.all-finder-layer .finder-body').stop(true, true).animate({ right: '-=' + _right_width }, 500, function() { $(this).hide(); }); } }); // 다찾다 레이어 닫기 $('.all-finder-layer .finder-body a.finder-close').on('click', function(e) { e.preventDefault(); $('.all-finder-layer .finder-body').stop(true, true).animate({ right: '-=' + _right_width }, 500, function() { $(this).hide(); }); $('#allfinder-ctr a').removeClass('open'); }); // 다찾다 레리어 - 카테고리 열기 닫기 $('.all-finder-layer .category-toggle').click(function(e){ e.preventDefault(); $(this).toggleClass('fa-minus'); $('.all-finder-layer .finder-category').toggleClass('open'); }); }); })(jQuery);