$(document).ready(function () { load_document() }) // 헤더 로드영역 function load_document() { $('.header .header_inner .allmenu_area .btn_allmenu').on('click', function () { $('body').css({ 'overflow': 'hidden', }) $('.wrapper').addClass('allmenu_open') }); $('.header .header_inner .menu_list > ul > li > a').on('mouseover', function () { $('.header .header_inner .menu_list > ul > li > a').removeClass('active') $('.header .header_inner .menu_list > ul > li > .menu_list_depth2').removeClass('on') $(this).addClass('active') $(this).siblings('.menu_list_depth2').addClass('on') }); $('.header').on('mouseleave', function () { $('.header .header_inner .menu_list > ul > li > a').removeClass('active') $('.header .header_inner .menu_list > ul > li > .menu_list_depth2').removeClass('on') }); // 셀렉트 박스 이벤트 $('.footer .footer_inner .select_box > dt > a').on('click', function (e) { e.preventDefault() if ($(this).parent().hasClass('active')) { $(this).parent().removeClass('active') $(this).parent().siblings('dd').children().removeClass('on') return false; } $(this).parent().addClass('active') $(this).parent().siblings('dd').children().toggleClass('on') }); $('.footer .footer_inner .select_box .select_list_area > ul > li > a').on('click', function (e) { e.preventDefault(); $('.footer .footer_inner .select_box .select_list_area').removeClass('on') $('.footer .footer_inner .select_box > dt').removeClass('active') }); // 플루팅 버튼 이벤트 $('.footer .footer_inner .float_btn_wrap .btn_float').off().on('click', function (e) { // touchstar mouseenter 이벤트 개선 e.preventDefault() $('html,body').animate({ scrollTop: 0, }) }); $(window).on('scroll', function () { var float_target = $(this).scrollTop() if (float_target >= 100) { $('.footer .footer_inner .float_btn_wrap').css({ 'opacity': '1', 'visibility': 'visible' }) } else if (float_target <= 100) { $('.footer .footer_inner .float_btn_wrap').css({ 'opacity': '0', 'visibility': 'hidden' }) } }); // aside 메뉴 로드 $('#sidebar .snb_list .depth2').off().on('click', function (e) { e.preventDefault(); if (!$(this).hasClass('active')) { $(this).siblings('.depth3_list').slideDown() $(this).addClass('active') } else if ($(this).hasClass('active')) { $(this).siblings('.depth3_list').slideUp() $(this).removeClass('active') } }); // allmenu 닫기버튼 이벤트 $('.allmenu_wrap .btn_close_wrap .btn_close').on('click', function (e) { e.preventDefault(); $('body').css({ 'overflow': '', }) $('.wrapper').removeClass('allmenu_open') }); // allmenu 1뎁스 이벤트 $('.allmenu_wrap .allmenu_body .allmenu_list > ul > li > a').on('click', function (e) { e.preventDefault(); $('.allmenu_wrap .allmenu_body .allmenu_list > ul > li > a').removeClass('active') $(this).addClass('active') var this_target = $(this).data().allmenuBtn var target_content = $('.allmenu_wrap .allmenu_body .allmenu_lnb[data-allmenu-content=' + this_target + ']') $('.allmenu_wrap .allmenu_body .allmenu_lnb').removeClass('on') target_content.addClass('on') }); // allmenu 2뎁스 이벤트 $('.allmenu_wrap .allmenu_lnb .depth2').off().on('click', function (e) { e.preventDefault(); if (!$(this).hasClass('active')) { $(this).siblings('.depth3_list').slideDown() $(this).addClass('active') } else if ($(this).hasClass('active')) { $(this).siblings('.depth3_list').slideUp() $(this).removeClass('active') } }); // $('.header').load('header_en.html .header .header_inner', function () { // $('.header .header_inner .allmenu_area .btn_allmenu').on('click', function () { // $('body').css({ // 'overflow': 'hidden', // }) // $('.wrapper').addClass('allmenu_open') // }) // // $('.header .header_inner .menu_list > ul > li > a').on('mouseover', function () { // $('.header .header_inner .menu_list > ul > li > a').removeClass('active') // $('.header .header_inner .menu_list > ul > li > .menu_list_depth2').removeClass('on') // $(this).addClass('active') // $(this).siblings('.menu_list_depth2').addClass('on') // }) // $('.header').on('mouseleave', function () { // $('.header .header_inner .menu_list > ul > li > a').removeClass('active') // $('.header .header_inner .menu_list > ul > li > .menu_list_depth2').removeClass('on') // }) // // }) // $('.footer').load('footer_en.html .footer .footer_inner', function () { // // // 셀렉트 박스 이벤트 // $('.footer .footer_inner .select_box > dt > a').on('click', function (e) { // e.preventDefault() // if ($(this).parent().hasClass('active')) { // $(this).parent().removeClass('active') // $(this).parent().siblings('dd').children().removeClass('on') // return false; // } // $(this).parent().addClass('active') // $(this).parent().siblings('dd').children().toggleClass('on') // }) // // $('.footer .footer_inner .select_box .select_list_area > ul > li > a').on('click', function (e) { // e.preventDefault(); // $('.footer .footer_inner .select_box .select_list_area').removeClass('on') // $('.footer .footer_inner .select_box > dt').removeClass('active') // }) // // // 플루팅 버튼 이벤트 // // $('.footer .footer_inner .float_btn_wrap .btn_float').off().on('click', function (e) { // // touchstar mouseenter 이벤트 개선 // e.preventDefault() // $('html,body').animate({ // scrollTop: 0, // }) // }) // // $(window).on('scroll', function () { // var float_target = $(this).scrollTop() // if (float_target >= 100) { // $('.footer .footer_inner .float_btn_wrap').css({ // 'opacity': '1', // 'visibility': 'visible' // }) // } else if (float_target <= 100) { // $('.footer .footer_inner .float_btn_wrap').css({ // 'opacity': '0', // 'visibility': 'hidden' // }) // } // }) // // // aside 메뉴 로드 // $('#sidebar').load('aside_en.html #sidebar .snb_list', function () { // $('#sidebar .snb_list .depth2').off().on('click', function (e) { // e.preventDefault(); // if (!$(this).hasClass('active')) { // $(this).siblings('.depth3_list').slideDown() // $(this).addClass('active') // } else if ($(this).hasClass('active')) { // $(this).siblings('.depth3_list').slideUp() // $(this).removeClass('active') // } // }) // }) // }) // // // aside 메뉴 로드 // $('#sidebar').load('aside_en.html #sidebar .snb_list', function () { // $('#sidebar .snb_list .depth2').off().on('click', function (e) { // e.preventDefault(); // if (!$(this).hasClass('active')) { // $(this).siblings('.depth3_list').slideDown() // $(this).addClass('active') // } else if ($(this).hasClass('active')) { // $(this).siblings('.depth3_list').slideUp() // $(this).removeClass('active') // } // }) // }) // // $('.allmenu_wrap').load('allmenu_en.html .allmenu_wrap .allmenu_inner', function () { // // allmenu 닫기버튼 이벤트 // $('.allmenu_wrap .btn_close_wrap .btn_close').on('click', function (e) { // e.preventDefault(); // $('body').css({ // 'overflow': '', // }) // $('.wrapper').removeClass('allmenu_open') // }) // // // allmenu 1뎁스 이벤트 // $('.allmenu_wrap .allmenu_body .allmenu_list > ul > li > a').on('click', function (e) { // e.preventDefault(); // $('.allmenu_wrap .allmenu_body .allmenu_list > ul > li > a').removeClass('active') // $(this).addClass('active') // var this_target = $(this).data().allmenuBtn // var target_content = $('.allmenu_wrap .allmenu_body .allmenu_lnb[data-allmenu-content=' + this_target + ']') // $('.allmenu_wrap .allmenu_body .allmenu_lnb').removeClass('on') // target_content.addClass('on') // }) // // // allmenu 2뎁스 이벤트 // $('.allmenu_wrap .allmenu_lnb .depth2').off().on('click', function (e) { // e.preventDefault(); // if (!$(this).hasClass('active')) { // $(this).siblings('.depth3_list').slideDown() // $(this).addClass('active') // } else if ($(this).hasClass('active')) { // $(this).siblings('.depth3_list').slideUp() // $(this).removeClass('active') // } // }) // }) }