$(document).ready(function(){ // 메뉴 액션 $(".topnav").hover(function() { $(this).parent().find(".subnav").show(); $(this).parent().hover(function() { }, function(){ $(this).parent().find(".subnav").hide(); }); }); // 사이트맵 토글 $(".site_map_btn").click(function() { $("#site_map").slideToggle(300); }); // footer 탑버튼 액션 $('#back-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); // 퀵메뉴 탑버튼 애니 $('.quick_top').click(function () { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); // 팝업 닫기 $('.popup .popup_box .close').click(function () { $('.popup').fadeOut(300); document.body.classList.remove("stop-scroll"); }); }); // 팝업 함수 // function openModal(modalname,e) { // document.get // $("." + modalname).fadeIn(300); // document.body.classList.add("stop-scroll"); // } // jQuery.fn.anchorAnimate = function (settings) { // settings = jQuery.extend({ // speed: 700, // offset: 227 // }, settings); // return this.each(function () { // var caller = this // $(caller).click(function (event) { // event.preventDefault() // var locationHref = window.location.href // var elementClick = $(caller).attr("href") // var destination = $(elementClick).offset().top; // $("html:not(:animated),body:not(:animated)").animate({ // scrollTop: destination // }, settings.speed, function () { // window.location.hash = elementClick // }); // return false; // }) // }) // } 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 활성 } $(".snb li.sn" + page.sn).find(" a").addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth 활성 }