$(document).ready(function () { // header °íÁ¤ $(window).on('scroll', function () { if ($(window).scrollTop()) { $('#header').addClass('active'); } else { $('#header').removeClass('active'); } }); // Çܹö°Å ¸Þ´º $('#header .hamberg').click(function () { $(this).children('span').toggleClass('on'); $('#header .nav_wrap').toggleClass('on'); }); // header À̺¥Æ® function setMenuEvents() { $('#header .menu > li').off('mouseover mouseleave click'); const slideMenu = (selector, child) => { $(selector).on('mouseover', function () { $(this).children(child).stop().slideDown(); }).on('mouseleave', function () { $(this).children(child).stop().slideUp(); }); }; if (window.innerWidth >= 899) { slideMenu('#header .menu > li:has(.submenu)', '.submenu'); } else { $('#header .menu > li').on('click', function () { const $submenu = $(this).children('.submenu'); $('.submenu').not($submenu).slideUp(); $submenu.slideToggle(); }).each(function () { if ($(this).children('.submenu').length > 0) { $(this).children('a').attr('href', 'javascript:void(0);'); } }); } } $(window).on('resize', setMenuEvents); // È­¸é Å©±â º¯°æ ½Ã Àç¼³Á¤ $(document).ready(setMenuEvents); // ÃÊ±â ·Îµå ½Ã ¼³Á¤ //faq $(".faq_list .ask").click(function () { var answer = $(this).next("div"); // ¸ðµç ´Ù¸¥ Ç׸ñÀÇ 'on' Ŭ·¡½º Á¦°ÅÇÏ°í ´äº¯ ´Ý±â $(".faq_list .ask").not(this).removeClass("on"); $(".faq_list .answer").not(answer).slideUp(); // Ŭ¸¯ÇÑ Ç׸ñ Åä±Û $(this).toggleClass("on"); answer.slideToggle(); }); // ÆË¾÷ Æû $('a.popView').attr('href', 'javascript:void(0);'); $('.popView').click(function () { var pop_id = $(this).attr('data-pop'); $("#" + pop_id).addClass('on'); }); $('.pop_wrap .cancel, .pop_wrap .close').click(function () { $(this).attr('href', 'javascript:void(0);'); $(this).parents('.pop_wrap').removeClass('on'); }); // tab $('.tab_menu li').click(function () { var tab_id = $(this).attr('data-tab'); $('.tab_menu li').removeClass('on'); $('.tab_cont').removeClass('on'); $(this).addClass('on'); $("#" + tab_id).addClass('on'); }); });