$(document).ready(function () { $(window).scroll(function () { var scrollTop = $(document).scrollTop(); if (scrollTop < 197) { scrollTop = 197; } $("#quick_menu").stop(); $("#quick_menu").animate({ "top": scrollTop }); }); // $('.quick_btn').click(function () { // if ($('#quick_menu').hasClass('hidden')) { // $('#quick_menu').animate({ // 'right': 0 // }, 300, function () { // $('#quick_menu').removeClass('hidden'); // }); // } else { // $('#quick_menu').animate({ // 'right': -($('#quick_menu').outerWidth()) // }, 300, function () { // $(this).addClass('hidden'); // }); // }; // }); // 메뉴 $("nav.pc_nav ul").mouseover(function(){ $("nav.pc_nav ul ul").stop().slideDown(200); $(".subnav_bg").stop().slideDown(200); $("#header nav > .inner > ul > li > .subnav > li > a").css("opacity", "1"); }); $("nav.pc_nav ul").mouseout(function(){ $("nav.pc_nav ul ul").stop().slideUp(200); $(".subnav_bg").stop().slideUp(200); $("#header nav > .inner > ul > li > .subnav > li > a").css("opacity", "0"); }); // 사이트맵 $(".site_map_btn").click(function () { $("#site_map").slideToggle(300); }); // 푸터 top 버튼 $('#back-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 1000); return false; }); // 모바일 메뉴 $(".menu_btn").click(function () { $("#m_menu").toggleClass("on"); // $('#blank').show(); if (!$("#m_menu").hasClass("on")) { $('html, body').css({ 'overflow': 'auto' }); $(this).off('scroll touchmove mousewheel'); } else { $('html, body').css({ 'overflow': 'hidden' }); $(this).on('scroll touchmove mousewheel', function (event) { event.preventDefault(); event.stopPropagation(); return false; }); } }); $(".close_btn").click(function () { $("#m_menu").removeClass("on"); // $('#blank').remove(); if (!$("#m_menu").hasClass("on")) { $('html, body').css({ 'overflow': 'auto' }); $(this).off('scroll touchmove mousewheel'); } else { $('html, body').css({ 'overflow': 'hidden' }); $(this).on('scroll touchmove mousewheel', function (event) { event.preventDefault(); event.stopPropagation(); return false; }); } }); $('#m_menu .m_nav ul li a').on('click', function () { if ($(this).hasClass('active')) { $(this).closest('li').find('ul').removeClass('active'); $(this).removeClass('active'); return false; } if ($(this).closest('li').find('ul').length > 0) { $(this).closest('li').find('ul').addClass('active'); $(this).addClass('active'); return false; } }); // sub6_6 $('.faq .q_box').click(function () { $(this).toggleClass('active').next('.sub_nav').slideToggle(); $(this).parent("li").toggleClass('active'); if ($(this).hasClass('active')) { $(this).find('.xi-plus-min').removeClass().addClass('xi-minus-min'); } else { $(this).find('.xi-minus-min').removeClass().addClass('xi-plus-min'); } }); // 서브탭메뉴 // var tabLink = $(".tab_nav li"), // subLink = $(".tab_menu li"), // currentUrl = location.href, // tabContent = $("#tab_box > div"); // tabLink.click(function(e){ // e.preventDefault(); // var targetIdx = $(this).index(); // activateTab(targetIdx); // }); // subLink.click(function(){ // var targetIdx = $(this).index(); // console.log(targetIdx); // activateTab(targetIdx); // $("#site_map").css("display", "none"); // }); // subLink.each(function(i){ // var conpareUrl = $(this).find("a").attr('href'); // var active = currentUrl.indexOf(conpareUrl) // var blank = currentUrl.indexOf('#'); // if(active > -1) { // activateTab(i); // } // if (blank == -1) { // activateTab(0); // } // }); // function activateTab(idx) { // tabContent.hide(); // tabLink.removeClass("active"); // tabLink.eq(idx).addClass("active"); // tabContent.eq(idx).show(); // } var sub_menu = $(".tab_menu li, .m_nav_sub li"), tab_menu = $(".tab_nav li"), tab_content = $("#tab_box > div"), currentUrl = location.href; sub_menu.each(function(){ var targetSrt = $(this).find("a").attr("href"); if(currentUrl.indexOf(targetSrt) > -1) { var targetIdx = $(this).index(); activateTab(targetIdx); } if(currentUrl.indexOf("#") == -1) { activateTab(0); } }); tab_menu.click(function(e){ e.preventDefault(); activateTab($(this).index()); }); sub_menu.click(function(){ activateTab($(this).index()); $("#site_map").css("display","none"); $("#m_menu").removeClass("on"); $("html, body").css("overflow","auto"); }); function activateTab(idx) { tab_menu.find("a").removeClass("active"); tab_menu.eq(idx).find("a").addClass("active"); tab_content.hide(); tab_content.eq(idx).show(); } }); function setPage(arg) { //navigation hn:1depth, sn:2depth, cn:3depth 瑜� 諛쏆쓬 page = jQuery.extend({ hn: "", sn: "", cn: "" }, arg || {}); if (window.console) { console.log("hn : " + page.hn + "\nsn : " + page.sn + "\ncn : " + page.cn); } if (page.hn != 10) { $(".hn" + page.hn + " a").addClass("on"); //1depth �쒖꽦 } if (page.hn >= 11) { $(".hn" + page.hn + " a").addClass("on"); //�좏떥 1depth �쒖꽦 } $(".hn" + page.hn + "> .subnav li.sn" + page.sn).addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth �쒖꽦 }