$(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'); $('#header .lang').off('mouseover mouseout'); 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'); slideMenu('#header .lang', '.langmenu'); } 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); // ÃÊ±â ·Îµå ½Ã ¼³Á¤ // ÇÁ·ÎÁ§Æ® ÅÇ Å¬¸¯ À̺¥Æ® $(".pj_wrap .pj_tab li").on("click", function () { const $tabs = $(".pj_wrap .pj_tab li"); const $items = $(".pj_item, .pje_item"); const category = $(this).data("category"); // ÅÇ È°¼ºÈ­ ó¸® $tabs.removeClass("active"); $(this).addClass("active"); if (category === "all") { // etc Ç׸ñ¸¸ Á¦¿ÜÇÏ°í ¸ðµÎ Ç¥½Ã $items.show(); } else { // ÇØ´ç Ä«Å×°í¸®¸¸ Ç¥½Ã $items.hide().filter(`.${category}`).show(); } }); // ai ½ºÅ©·Ñ À̺¥Æ® $(window).on('scroll', function () { if ($(window).scrollTop()) { $('.ai_fixed .bg').addClass('on'); } else { $('.ai_fixed .bg').removeClass('on'); } }); $(window).on('scroll', function () { var triggerPoint = $(window).height() * 1; // 50vh ¡æ Çȼ¿·Î ȯ»ê if ($(window).scrollTop() > triggerPoint) { $('.ai_fixed .cont').addClass('on'); } else { $('.ai_fixed .cont').removeClass('on'); } }); });