$(document).ready(function () { //info popup $('.form-more-btn').on('click', function () { var target = $(this).attr('href'); event.preventDefault(); $(target).fadeIn(); }); $('.popup-close-btn').on('click', function () { var target = $(this).attr('href'); event.preventDefault(); $(this).parents('.popup-layer').fadeOut(); }); //sub-category var subMenu = $('.sub-menu-wrap'); $('.main-category .last-li').on('mouseover', function () { subMenu.stop().fadeIn(); }); subMenu.on('mouseout, mouseleave', function () { $(this).stop().fadeOut(); }); //quick menu var defaultTop = parseInt($('.quick-menu').css('top')); $(window).on('scroll', function () { var scrTop = $(window).scrollTop(); $('.quick-menu').stop().animate({ top: scrTop + defaultTop + 'px' }, 1000); }); //top btn $(".topBtn a").click(function () { $("html, body").animate({ scrollTop: 0 }, 1000); return false; }); //체크박스 체크 유지 $('.section .col-1 .sm-form-wrap.item input[type=checkbox]').attr('checked', true); $('.sm-form2 .sm-form2-box input[type=checkbox]').attr('checked', true); $('#counseling-page input[type=checkbox]').attr('checked', true); //메뉴 트리거 버튼 $('.side-bar a').click(function () { $(".mb-menu").show(); $(".mb-menu").animate({ right: "0px" }, 500); $(".opacity_box").css("display", "block"); $(".m-menu-box").hide(); }); $(".opacity_box").click(function () { // $(".mb-menu").hide(); $(".mb-menu").animate({ right: "-700px" }, 500); $(".opacity_box").css("display", "none"); $(".m-menu-box").show(); }); var childMenu = $(".child_menu"); childMenu.hide(); $('.sub-menu a').click(function() { $('.sub-menu a').removeClass('on'); childMenu.stop().slideUp().removeClass("on"); if (!$(this).next().is(":visible")) { $(this).next().slideDown().addClass("on"); $('.sub-menu a').addClass('on'); } }) });