1 2 3 4(function ($) { 5 6 ///////////////////////// 7 $(function () { 8 9 10 // í¸ì§ 모ë ì¤í¬ë¦½í¸ê° í¬í¨ë íì´ì§ì¸ì§ íì¸ 11var isEditMode = 12 $('script[src*="dimode.page.editmode.theme.js"]').length > 0; 13 14// mmenuë í¸ì§ 모ëììë ì´ê¸°ííì§ ìì 15// ì¼ë° íì´ì§ììë DOM Ready ìì ì 먼ì ì´ê¸°í 16if ( 17 !isEditMode && 18 $("#my-menu").length && 19 !$("#my-menu").hasClass("mm-menu") 20) { 21 $("#my-menu").mmenu({ 22 "slidingSubmenus": false, 23 "extensions": [ 24 "effect-menu-slide", 25 "pageshadow", 26 "pagedim-black" 27 ], 28 "offCanvas": { 29 "position": "right", 30 "zposition": "front" 31 }, 32 "navbar": { 33 "title": "ê³ ì²êµí" 34 } 35 }); 36} 37 38// ìë ë©ë´ ì´ë²¤í¸ë window.loadê¹ì§ 기ë¤ë¦´ íìê° ìì 39$(".sub_depth2 li.active i.fa-plus").hide(); 40$(".sub_depth2 li.active i.fa-minus").show(); 41 42$(".sub_depth2 li i.fa-plus").off("click").on("click", function () { 43 $(this).next().next().next("ul.sub_depth3").addClass("active"); 44 $(this).hide(); 45 $(this).next().show(); 46}); 47 48$(".sub_depth2 li i.fa-minus").off("click").on("click", function () { 49 $(this).next().next("ul.sub_depth3").removeClass("active"); 50 $(this).hide(); 51 $(this).prev().show(); 52}); 53 54 55 56 57 58 59 // // // // //ìë¡ì´ gnb ë°©ì - í¸ë² ì ì´ë¦¼ 60 // // // // $(function () { 61 // // // // var menuCloseTimer = null; 62 63 // // // // // ë©ë´ í목ì ë§ì°ì¤ë¥¼ ì¬ë ¸ì ë 64 // // // // $("#gnb > .depth1 > li").on("mouseenter", function () { 65 // // // // clearTimeout(menuCloseTimer); // ë«í íì´ë¨¸ ì¤ë¨ 66 67 // // // // var d2 = $(this).children(".depth2").html(); 68 // // // // $("#gnb > .depth1 > li").removeClass("active"); 69 // // // // $(this).addClass("active"); 70 71 // // // // $("#menubar .container .row").html(d2); 72 // // // // $("#menubar").stop(true, true).fadeIn(200); 73 // // // // }); 74 75 // // // // // gnb ëë menubarìì ë§ì°ì¤ê° ë²ì´ë ë ëë ì´ í ë«ê¸° 76 // // // // $("#gnb, #menubar").on("mouseleave", function () { 77 // // // // menuCloseTimer = setTimeout(function () { 78 // // // // $("#gnb > .depth1 > li").removeClass("active"); 79 // // // // $("#menubar").stop(true, true).fadeOut(200); 80 // // // // }, 100); // ëë ì´ ìê° (ms) 81 // // // // }); 82 83 // // // // // gnb ëë menubarë¡ ë¤ì ë§ì°ì¤ ë¤ì´ì¤ë©´ ë«í ì·¨ì 84 // // // // $("#gnb, #menubar").on("mouseenter", function () { 85 // // // // clearTimeout(menuCloseTimer); 86 // // // // }); 87 // // // // }); 88 89 ///////////////////////////////////////////////////////////////////////////////////////////// 90 ///////////////////////////////////////////////////////////////////////////////////////////// 91 92 function resetWidth($sub) { 93 // í 220 기본ì¼ë¡ (ë«ì ëë§ í¸ì¶) 94 $sub.removeClass('expanded').css('width', ''); 95 } 96 97 // íì¬ px â 목í px(ì«ì)ë¡ í ë²ì ì í 98 function smoothSetHeightPx($el, targetPx) { 99 const el = $el[0]; 100 const current = el.getBoundingClientRect().height; 101 $el.css('height', current + 'px'); 102 el.offsetHeight; // reflow 103 $el.css('height', Math.max(0, Math.round(targetPx)) + 'px'); 104 } 105 106 // depth3 모ë ë«í "기본 컨í ì¸ " ëì´ ì¸¡ì /ì ì¥ 107 function updateBaseHeight($sub) { 108 const $opened = $sub.find('> li > .depth3.is-open'); // í´ëì¤ë§ ê¸°ì¤ 109 $opened.removeClass('is-open').css({ opacity: '', display: '' }); 110 111 const prev = $sub.css('height'); 112 $sub.css('height', 'auto'); 113 const h = $sub[0].scrollHeight; 114 $sub.css('height', prev); 115 $sub.data('baseH', h); 116 117 // 측ì ë: ìì복구 íì ìì(ë«í ìì´ì¼ 기본 ëì´ê° ë§ì) 118 } 119 120 // depth3 íì/ì¨ê¹ (í´ëì¤ë§) 121 function d3Open($d3) { 122 $d3.css('display', '').addClass('is-open').css({ opacity: 0 }); 123 requestAnimationFrame(() => $d3.css('opacity', 1)); 124 125 $d3.addClass('is-open'); 126 } 127 function d3Close($d3) { 128 $d3.removeClass('is-open').css({ opacity: '', display: '' }); 129 130 $d3.removeClass('is-open'); 131 } 132 133 /* âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 134 ì í ë¡ì§ (í목 ê° ì´ë) 135 âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */ 136 let pendingRaf = 0; 137 function atomicSwitchToItem($sub, $toItem) { 138 // í´ë¦ ì¤ì´ë©´ ì í ê¸ì§(íí¸ë°ì¤ íë¤ë¦¬ì§ ìê²) 139 if ($sub.closest('#gnb > li').data('clickLock')) return; 140 141 cancelAnimationFrame(pendingRaf); 142 pendingRaf = requestAnimationFrame(() => { 143 const padTop = parseInt($sub.css('padding-top')) || 0; 144 const baseH = $sub.data('baseH') ?? (updateBaseHeight($sub), $sub.data('baseH')); 145 const $toD3 = $toItem.children('.depth3'); 146 const $fromD3 = $sub.find('> li > .depth3.is-open').not($toD3); 147 148 if ($toD3.length) { 149 // í ì ê¸(330) â ë«ì ëê¹ì§ ì ì§ 150 //$sub.addClass('expanded'); 151 152 // depth3 ì´ê¸° + ëì´ ì§í 153 d3Open($toD3); 154 //const need = $toItem.position().top + $toD3.outerHeight(true) + padTop; 155 //smoothSetHeightPx($sub, Math.max(baseH, need)); 156 157 // ì´ì depth3ë ë¤ì íë ìì ë«ê¸° 158 requestAnimationFrame(() => d3Close($fromD3)); 159 } else { 160 // íì ìì: íì ì ì§, ëì´ë§ 기본ì¼ë¡ 161 smoothSetHeightPx($sub, baseH); 162 d3Close($fromD3); 163 } 164 }); 165 } 166 167 /* âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 168 ì´ê¸°/ë«ê¸° 169 âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */ 170 const CLOSE_DELAY = 240; 171 172 function openSub($li) { 173 clearTimeout($li.data('hideTimer')); 174 const $sub = $li.children('.subal'); 175 const liH = $li.outerHeight(); 176 177 // ë³´ì¬ì£¼ê³ (ì íí top), 기본 í/ëì´ë¡ ìì 178 $sub.css({ visibility: 'visible', opacity: 1, top: liH + 'px' }); 179 resetWidth($sub); // íì 220ì¼ë¡ ìì 180 $sub.removeData('baseH'); 181 updateBaseHeight($sub); 182 smoothSetHeightPx($sub, $sub.data('baseH')); 183 184 $li.addClass('open') 185 .siblings().removeClass('open') 186 .children('.subal').each(function () { 187 const $s = $(this); 188 $s.css({ visibility: 'hidden', opacity: 0, top: (liH + 4) + 'px' }); 189 smoothSetHeightPx($s, 0); 190 resetWidth($s); 191 d3Close($s.find('.depth3')); 192 }); 193 } 194 195 function closeSub($li) { 196 // í´ë¦ ì¤ì ë«ì§ ìì (í´ë¦ ìë£ í 문ì mouseupìì í´ì ) 197 if ($li.data('clickLock')) return; 198 199 clearTimeout($li.data('hideTimer')); 200 const $sub = $li.children('.subal'); 201 const liH = $li.outerHeight(); 202 203 const t = setTimeout(() => { 204 $li.removeClass('open'); 205 d3Close($sub.find('.depth3')); 206 $sub.removeClass('expanded') 207 .css({ opacity: 0, top: (liH + 4) + 'px', visibility: 'hidden' }); 208 smoothSetHeightPx($sub, 0); 209 resetWidth($sub); 210 }, CLOSE_DELAY); 211 212 $li.data('hideTimer', t); 213 } 214 215 /* âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 216 ì´ë²¤í¸ ë°ì¸ë© (PC hover ì ì©) 217 âââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */ 218 // 기존 ë°ì¸ë© ì ê±°(ì¤ë³µ ë°©ì§) 219 $("#gnb-child > li").off("mouseenter mouseleave focusin focusout"); 220 $("#gnb-child > li .subal").off("mouseenter mouseleave"); 221 222 // hoverë¡ ì´ê³ ë«ê¸° 223 $("#gnb-child > li").on("mouseenter", function () { openSub($(this)); }); 224 $("#gnb-child > li").on("mouseleave", function () { closeSub($(this)); }); 225 226 // ìë¸ í목ì ì¬ë ¸ì ë ì í 227 $(".subal > li").on("mouseenter", function () { 228 const $item = $(this); 229 const $sub = $item.closest('.subal'); 230 atomicSwitchToItem($sub, $item); 231 });
232 233 // depth3 ìììë ì ì§(ê°ì ì í ë¡ì§ ì¬ì¬ì©) 234 $(".subal .depth3").on("mouseenter", function () { 235 const $sub = $(this).closest('.subal'); 236 const $li = $(this).closest('.subal > li'); 237 atomicSwitchToItem($sub, $li); 238 }); 239 240 // í´ë¦ ì¤ ì ê¸(ê¹ë¹¡ì/ì¤í´ë¦ ë°©ì§) 241 $('#gnb-child').on('mousedown', '#gnb-child > li .subal, #gnb-child > li .subal *', function () { 242 const $li = $(this).closest('#gnb-child > li'); 243 $li.data('clickLock', true); 244 $li.children('.subal').addClass('expanded'); // í´ë¦ ìê° í/ëì´ ì ì§ 245 }); 246 $(document).on('mouseup', function () { 247 // ì½ê°ì ì ì í ì ê¸ í´ì 248 setTimeout(() => { $('#gnb-child > li').removeData('clickLock'); }, 200); 249 }); 250 ///////////////////////////////////////////////////////// 251 252 253 254 $('.all-menu').click(function () { 255 $(this).find('ul').toggleClass('active'); 256 $('.gnb-all').slideToggle(500); 257 }); 258 $('.close').click(function () { 259 $(this).parents('all-menu').find('ul').toggleClass('active'); 260 $('.gnb-all').slideToggle(500); 261 }); 262 263 264 265 }); 266})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.