$( document ).ready( function() { $('.burger_btn').click( function() { $('#aside').removeClass( 'side-left' ); $('#aside').addClass( 'side-right' ); } ); $( '.btnClose' ).click( function() { $('#aside').removeClass( 'side-right' ); $( '#aside' ).addClass( 'side-left' ); } ); $( '#slidemenu .accordionmenu' ).click( function() { console.log('bbb'); $(this > 'ol.side_subMenu').toggleClass( 'sub-tab' ); } ); $( '#slidemenu .accordionmenu' ).click( function() { console.log('bbb'); $(this).children( 'ol.side_subMenu' ).toggleClass( 'sub-tab' ); } ); } ); (function($){ $(function(){ var idx = 1; var pgPrefix = ".skw-page-"; var pageNum = 7; $('.skw-wrap').on('click',pageClick); var duration = 250; function pageClick() { $('.skw-wrap').off('click'); if (idx < pageNum) { idx++; $(pgPrefix + idx).addClass("active"); $(pgPrefix + (idx + 1)).removeClass("active"); $('.skw-wrap').on('click',pageClick); } else { for (var i=pageNum;i>0;i--) { (function(i){ setTimeout(function(){ if ($(pgPrefix + i).hasClass('active')) $(pgPrefix + i).removeClass("active"); if (i==1) { $('.skw-wrap').on('click',pageClick); idx=1; } },(duration*pageNum)-(duration*i)); })(i); } } } $('.skw-page__half--left .skw-page__content a').click(function(e){ e.preventDefault(); }) }); })($$); $(document).ready(function() { // $('nav li').hover( // function() { // var obj = $('ul', this); // if(obj.attr("data-slide") != "on") { // obj.attr("data-slide", "on") // obj.fadeIn(200, function() { // //obj.attr("data-slide", "off"); // }); // } // }, // function() { // var obj = $('ul', this); // obj.fadeOut(70, function() { // obj.attr("data-slide", "off"); // }); // } // ); }); $(function(){ // 회원가입 동의 자세히보기 $('.fd-detail-des').click(clickJoinDes); // 헤더 유저 마우스오버 이벤트 $('.user-menu').mouseover(overUserIcon).mouseleave(leaveUserIcon); // faq 게시판 펼치기/접기 $('.fd-tit-label').click(toggleFAQ); // 주문 하나씩 펼치기 $('.fd-join-prev').click(clickJoinPrev); $('.fd-join-next').click(clickJoinNext); // 상품상세 리뷰 showDetailReview(); // $('fd-review-more').click(clickReviewMore); // 헤더 shop 메뉴 펼치기 이벤트 $('.fd-shop').mouseover(overShopMenu).mouseleave(leaveShopMenu); // q&a 비밀글 자동설정 setSecretWrite(); // 인스타그램 $('#instagramWidgetManual').mouseover(hoverInsta); // 상세페이지 하단 안내정보 $('.bot-info-top').click(clickDetailBotinfo); // 메인페이지 헤더 투명 이벤트 //scrollHeaderEvent(); //$(window).scroll(scrollHeaderEvent); // 상품상세 - 구매버튼 이벤트 $('.fd-buy-btn').mouseover(overBuyBtn); $('.fd-buy-btn').mouseout(outBuyBtn); }); function clickJoinDes(e){ var target = $(e.currentTarget); target.closest('.fd-agree-box').children('.fd-agree-des').slideToggle(); } function overUserIcon(e){ var target = $(e.currentTarget); target.children('.user-pop').addClass('active'); } function leaveUserIcon(e){ var target = $(e.currentTarget); target.children('.user-pop').removeClass('active'); } function toggleFAQ(e){ var target = $(e.currentTarget); var icon = target.find('i.fas'); icon.toggleClass('fa-minus'); icon.toggleClass('fa-plus'); } // 주문 하나씩 펼치기 function clickJoinPrev(e){ var target = $(e.currentTarget); var prev_target = target.closest('.fd-join-cont').prev('.fd-join-cont').find('.fd-join-con'); $('.fd-join-con').slideUp(); prev_target.slideDown(); } function clickJoinNext(e){ var target = $(e.currentTarget); var next_target = target.closest('.fd-join-cont').next('.fd-join-cont').find('.fd-join-con'); $('.fd-join-con').slideUp(); next_target.slideDown(); } // 상품상세 리뷰 작성 이벤트 function clickReviewWrite(e){ var target = $(e.currentTarget); $('.review-write-cont').slideToggle(); } // 상품상세 리뷰 function showDetailReview(){ var con = $('.fd-review-head').find('p:first-child'); con.siblings('p').remove(); con.append("more"); } // 헤더 shop 메뉴 펼치기 이벤트 function overShopMenu(){ var menu = $('.fd-shop-menu'); menu.slideDown(); } function leaveShopMenu(){ var menu = $('.fd-shop-menu'); menu.slideUp(); } // Q&A 비밀글 자동설정 function setSecretWrite(){ var target = $('.fd-secret-cont'); target = target.find('input#secure1'); target.attr('checked', true); console.log(target); } // 인스타그램 function hoverInsta(e){ var target = $(e.currentTarget); var test = target.find('iframe'); console.log(test); } // 상세페이지 하단 안내정보 function clickDetailBotinfo(e){ var target = $(e.currentTarget); target.find('.it-right').toggleClass('xi-minus'); target.siblings('.bot-info-bot').slideToggle(); } // 메인페이지 헤더 투명 이벤트 /*function scrollHeaderEvent(){ if($('#section1.fd-main-sec01').hasClass('active')) { $('#top').addClass('active'); console.log('1'); } else { $('#top').removeClass('active'); console.log('2'); } }*/ // 상품상세 - 구매버튼 이벤트 function overBuyBtn(e){ var target = $(e.currentTarget); var check = $('.fd-option-list').find('.option_product'); if(check.length == 0) { target.text('SELECT OPTION!'); } else { if(target.hasClass('btn_01')) { target.text('CHECK OUT'); } else if(target.hasClass('btn_buy')) { target.text('BUY NOW'); } } } function outBuyBtn(e){ var target = $(e.currentTarget); var check = $('.fd-option-list').find('.option_product'); if(target.hasClass('btn_01')) { if(check.length == 0) { target.text('ADD TO BAG'); } else { target.text('CHECK OUT'); } } else if(target.hasClass('btn_buy')) { target.text('BUY NOW'); } } $(document).ready(function(){ $(".addBag").click(function(){ $(this).text("ADDED"); }); }); (function($){ $(function(){ var qs = window.location.search; var urlParam = new URLSearchParams(qs); var cate_no = urlParam.get('cate_no'); // 주소에서 category 주소 읽어옴 if (cate_no && location.pathname == '/product/list.html') { $('#menubar nav').addClass('hasCate_no').attr('data-cate',cate_no); } $('#menubar nav .container>ul>li>a,#menubar nav .container>ul>li>span').hover(function(){ if ($('#menubar nav .container>ul>li>.show').length) { $('#menubar nav .container>ul>li>.show').removeClass('show') } $(this).addClass('show'); if ($(this).next().get(0) && $(this).next().prop('tagName') == 'UL') { $(this).parent().find('.currentCategory').addClass('hide'); } }); $('#top').on('mouseleave',function(){ $('#menubar nav .container>ul>li>a.show').removeClass('show'); $('#menubar nav .currentCategory.hide').removeClass('hide'); }); }); })($$); function search_cont(){ $('#search_cont').css("width","294px"); $('#search_cont').css("overflow","unset"); $('#search_fieldset .searchUnderline').css("transition","all 0.5s ease-in-out"); $('#search_fieldset .searchUnderline').css("width","100%"); } function search_cont_off(){ $('#search_cont').css("width","0"); $('#search_cont').css("overflow","hidden"); $('#search_fieldset .searchUnderline').css("width","0"); $('#search_fieldset .searchUnderline').css("transition","all 0s ease-in-out"); } function gnb_bar(){ $('#gnb_bar').addClass('c'+Math.floor(Math.random() * 4)); $('#gnb_bar').css("height","96.8vh"); $('#gnb_bar').css("padding","12.1px 11px 0px 11px"); $('#gnb_bar').addClass("menuOn"); $('#gnb_bar *').css("opacity","1"); setTimeout(function(){ $('.gnb_middle').css("display","block"); }, 200); if( $('#gnb_bar').hasClass("menuOn") == true){ $('#menubar').css("opacity","0"); } } function gnb_bar_close(){ $('#gnb_bar').css("height","0"); $('#gnb_bar').css("padding","0px 11px 0px 11px"); $('#gnb_bar').removeClass("menuOn"); $('#gnb_bar *').css("opacity","0"); $('.gnb_middle').hide(); if( $('#gnb_bar').hasClass("menuOn") == false ){ $('#menubar').css("opacity","1"); } $('#gnb_bar').removeClass(); } if( $('#gnb_bar').has("menuOn") ) { $("#content").click(function(){ gnb_bar_close(); }); $("#listcontentWrap").click(function(){ gnb_bar_close(); }); $("#listcontentWrap2").click(function(){ gnb_bar_close(); }); } function product_subMenu(){ $('.product_subMenu').toggle(); var windowWidth = $( window ).width(); if(windowWidth < 640) { //창 가로 크기가 640 미만일 경우 if( $('.product_subMenu').css('display') === 'block' ){ $('.gnb_middle').css('display','none'); $('.gnb_top').css('margin-bottom','15.1676vh'); } else{ $('.gnb_middle').css('display','block'); $('.gnb_top').css('margin-bottom','30.1676vh'); } }else { //창 가로 크기가 640보다 클 경우 if( $('.product_subMenu').css('display') === 'block' ){ $('.gnb_top').css('margin-bottom','24.1676vh'); } else{ $('.gnb_top').css('margin-bottom','43.1676vh'); } } } $(".subMenuFc").hover(function(){ product_subMenu(); }); $(".product_subMenu").hover(function(){ product_subMenu(); }); function gnbBar_search_form(){ $('#topsearch').css('display','block'); $('.gnbBar_search').css('display','none'); } function gnbBar_search_form_close(){ $('#topsearch').css('display','none'); $('.gnbBar_search').css('display','block'); } var didScroll; var lastScrollTop = 0; var delta = 100; var navbarHeight = $('header').outerHeight(); var windowWidth = $( window ).width(); // 스크롤시에 사용자가 스크롤했다는 것을 알림 $(window).scroll(function(event){ didScroll = true; gnb_bar_close(); }); // hasScrolled()를 실행하고 didScroll 상태를 재설정 setInterval(function() { if (didScroll) { hasScrolled(); didScroll = false; } }, 250); function hasScrolled() { // 동작을 구현 var st = $(this).scrollTop(); // Make sure they scroll more than delta if(Number(st) <= delta) { return; } // If they scrolled down and are past the navbar, add class .nav-up. // This is necessary so you never see what is "behind" the navbar. if (st > lastScrollTop && st > navbarHeight){ // Scroll Down } else { // Scroll Up if(st + $(window).height() < $(document).height()) { } } lastScrollTop = st } /* $(".pre_order").mouseout(function(){ $(".pre_order").html("Daily Care"); $(".pre_order").css("font-family", "'font-family", "Neue Haas Grotesk Disp W05_55R"); }); preOrder(); $(".sub2_menu li:nth-child(1) a").mouseout(function(){ $(this).html("Mask"); $(this).css("font-family", "'font-family", "Neue Haas Grotesk Disp W05_55R"); }); $(".sub2_menu li:nth-child(2) a").mouseout(function(){ $(this).html("Base"); $(this).css("font-family", "'font-family", "Neue Haas Grotesk Disp W05_55R"); }); $(".sub2_menu li:nth-child(3) a").mouseout(function(){ $(this).html("Treatment"); $(this).css("font-family", "'font-family", "Neue Haas Grotesk Disp W05_55R"); }); */ /** * 문서 구동후 시작 */ $(document).ready(function(){ //placeholder $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){ var placeholderName = $(this).parents().attr('title'); $(this).attr("placeholder", placeholderName); }); /* placeholder ie8, ie9 */ $.fn.extend({ placeholder : function() { //IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴 if (hasPlaceholderSupport() === true) { return this; } //hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행 return this.each(function(){ var findThis = $(this); var sPlaceholder = findThis.attr('placeholder'); if ( ! sPlaceholder) { return; } findThis.wrap('