/* ---------- js ---------- */ jQuery(function ($) { /* 모바일 메뉴 열기 */ function mNav_open() { $(".btn-nav").addClass("mNav_open"); $("#header .navWrap").addClass("mNav_open"); $(".gnbMenuBg").fadeIn(); } function mNav_close() { $(".btn-nav").removeClass("mNav_open"); $("#header .navWrap").removeClass("mNav_open"); $(".gnbMenuBg").fadeOut(); } $(".btn-nav").click(function () { if (!$(this).hasClass("mNav_open")) { mNav_open(); } else { mNav_close(); } }); $(".gnbMenuBg,.mobile-header-close,.navWrap .gnb > li > a,.header-go-to-top").click(function () { mNav_close(); }); $(window).resize(function () { if ($(window).width() > 991) { mNav_close(); }; }); $(function() { function updateGnbBehavior() { if ($(window).width() > 991) { $('#header .gnb li > ul').hide(); $('#header .gnb > li') .off('mouseenter mouseleave') .hover( function() { $(this).children('ul').stop(true, true).slideDown(200); }, function() { $(this).children('ul').stop(true, true).slideUp(200); } ); } else { $('#header .gnb > li').off('mouseenter mouseleave'); $('#header .gnb li > ul').removeAttr('style'); } } updateGnbBehavior(); $(window).on('resize', updateGnbBehavior); }); $(window).scroll(function () { if ($(this).scrollTop() > 150) $('.go-to-top').fadeIn('slow'); else $('.go-to-top').fadeOut('slow'); }); $('.header-go-to-top').click(function () { $("html, body").animate({ scrollTop: 0 }, 500); return false; }); $('.go-to-top').click(function () { $("html, body").animate({ scrollTop: 0 }, 500); return false; }); $(".header-lang").each(function () { var $dropBox = $(this); var $dropOpenBtn = $dropBox.find(".lang-open-btn"); var $dropList = $dropBox.find("#headerLangList"); $dropOpenBtn.on("click", function (e) { e.stopPropagation(); $dropList.slideToggle(300); $dropBox.toggleClass("open"); }); $("body").on("click", function () { $dropList.slideUp(200); $dropBox.removeClass("open"); }); $(window).on("resize", function () { $dropList.removeAttr("style"); $dropBox.removeClass("open"); }); }); $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { var target = $(e.target).attr('href'); // "#location1" or "#location2" var containerId = target === '#location1' ? '#daumRoughmapContainer1747206965705' : '#daumRoughmapContainer1747207034814'; // Clear previous map before rendering $(containerId).empty(); // Render the appropriate map new daum.roughmap.Lander({ timestamp: target === '#location1' ? '1747206965705' : '1747207034814', key: target === '#location1' ? '2ozqp' : '2ozqt' }).render(); }); });