$(document).ready(function(){ $('#back-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 500); return false; }); // 모바일 메뉴 나타남 $(".menu_btn").click(function(e) { e.preventDefault(); $("#menu_box").toggleClass("on").css("visibility", "visible"); if (!$("#menu_box").hasClass("on")) { $("#menu_box").css("visibility", "hidden"); $('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; }); } }); // 모바일 서브 메뉴 나타남 $("#menu_box > ul > li").click(function() { $(this).children(".sub_menu").show(); $(this).siblings().children(".sub_menu").hide(); $(this).addClass("active").siblings().removeClass("active"); }); // 모달 사라짐 $('.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) { 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) { $("#gnb > ul > li.hn" + page.hn + " a").addClass("on"); } if (page.hn >= 11) { $("#gnb > ul > li.hn" + page.hn + " a").addClass("on"); } $(".snb ul li.sn" + page.sn).find(" a").addClass("on").end().find("> ul").addClass("on").find("> li.cn" + page.cn + " a").addClass("on"); //2depth �쒖꽦 }