1/* ******************************************************* 2 * filename : nav.js 3 * description : ë¤ë¹ê²ì´ì ë° ì¬ì´ëë° on ë± ë©ë´ì ê´ë ¨ë JS 4 * date : 2020-11-25 5******************************************************** */ 6 7var $snb = $(".snb"); 8var $snbMenu = $(".cm-top-menu"); 9// PC 10var $gnb = $("#gnb"); 11var $gnbList = $("#gnb > ul"); 12var $gnb_dep1 = $("#gnb > ul > li"); 13var $gnb_dep2 = $("#gnb > ul > li .gnb-2dep"); 14var $gnbBg = $('.gnb-overlay-bg'); 15// 모ë°ì¼ 16var $menuBtn = $("#header .nav-open-btn"); 17var $gnbM = $("#gnbM"); 18var $gnbMList = $gnbM.find("#navigation").children("li"); 19var $gnbMBg = $('.gnb-overlay-bg-m'); 20var menuState = false; 21 22// 모ë°ì¼ gnbì´ë¦° í ì°½ í¬ê²íìë ì¤í¬ë¡¤ë° ìì± 23$(window).resize(function () { 24 if ( menuState ) { 25 if ( getWindowWidth() > tabletWidth ) { 26 $("body").css({'height':'auto', 'overflow':'auto'}); 27 } 28 } 29}); 30 31/* *********************** PC NAV ************************ */ 32// gnb ì ì²´ë©ë´ 33function gnb_total_on () { 34 $gnbList.children("li").children("a").on("mouseenter focus",function () { 35 if (!($gnb.is(".open"))) { 36 $("#gnb").addClass("open"); 37 $gnbBg.stop().fadeIn(); 38 } 39 }) 40 41 $gnbList.on("mouseleave",gnb_return); 42 $gnbList.find("a").last().on("focusout",gnb_return); 43 44 function gnb_return () { 45 $("#gnb").removeClass("open"); 46 $gnbBg.hide(); 47 if ( dep1 > 0 && dep2 ) { 48 $gnbList.children("li").eq(dep1-1).addClass("active"); 49 } 50 } 51} 52 53// gnb ê°ê°ë©ë´ 54function gnb_each_on () { 55 $gnbList.children("li").children("a").on("mouseenter focus",function () { 56 $gnbList.children("li").removeClass("on").children(".gnb-2dep").removeClass("open"); //.hide(); 57 $(this).parent("li").addClass("on").children(".gnb-2dep").stop().addClass("open"); //.slideDown(500); 58 }) 59 60 $gnbList.children("li").on("mouseleave",gnb_return); 61 $gnbList.find("a").last().on("focusout",gnb_return); 62 63 function gnb_return () { 64 // if (!$gnb.find('*').is(':animated')) { 65 $gnbList.children("li").removeClass("on").children(".gnb-2dep").removeClass("open"); //.hide(); 66 // } 67 if ( dep1 > 0 && dep2 ) { 68 $gnbList.children("li").eq(dep1-1).addClass("active"); 69 } 70 } 71} 72 73$(document).ready(function () { 74 // gnb ë©ë´ì´ê¸° 75 if ( $gnb.is(".total-menu") ) { 76 gnb_total_on(); 77 }else if ( $gnb.is(".each-menu") ) { 78 gnb_each_on(); 79 } 80 81 // gnb 2ì°¨ ë©ë´ì ë§ì°ì¤ ì¬ë ¸ìë ëë©ë´ on 82 $gnb_dep2.hover(function(){ 83 $(this).parent("li").addClass("on"); 84 },function () { 85 $gnb_dep1.removeClass("on"); 86 }); 87}); 88 89 90/* *********************** MOBILE NAV ************************ */ 91// ë©ë´ì´ê¸° 92function menuOpen () { 93 menuState = true; 94 $menuBtn.addClass("active"); 95 $gnbM.addClass("open"); 96 $gnbMBg.fadeIn(); 97 $(".translate-select-wrap").addClass("on"); 98 $("body").css({'height':$(window).height(), 'overflow':'hidden'}); 99} 100// ë©ë´ë«ê¸° 101function menuClose () { 102 menuState = false; 103 $menuBtn.removeClass("active"); 104 $gnbM.removeClass("open"); 105 $gnbMBg.hide(); 106 $(".translate-select-wrap").removeClass("on"); 107 $("body").css({'height':'auto', 'overflow':'auto'}); 108} 109 110$(document).ready(function () { 111 // GNB MOBILE OPEN 112 $menuBtn.click(function () { 113 if ( menuState ) { 114 menuClose(); 115 }else { 116 menuOpen(); 117 } 118 return false; 119 }); 120 $gnbMBg.click(function () { 121 menuClose(); 122 }); 123 // GNB MOBILE 2DEPTH í´ëì¤ ë¶ì´ê¸° 124 $("#navigation > li:has('.gnb-2dep')").addClass("has-2dep"); 125 126 // GNB MOBILE 2DEPTH ì¤í 127 $("#navigation > li:has('.gnb-2dep')").children("a").click(function(event){ 128 /* 2depê° ì´ë ¤ììë */ 129 if ( $(this).parent("li").hasClass("active") ){ 130 $(this).parent("li").removeClass("active"); 131 $(this).children(".open-icon").hide(); 132 $(this).children(".close-icon").show(); 133 $(this).siblings(".gnb-2dep").slideUp(400); 134 } 135 /* 2depê° ë«íììë */ 136 else{ 137 $("#navigation > li").has(".gnb-2dep").each(function() { 138 if ( $(this).hasClass("active") ){ 139 $(this).removeClass("active"); 140 $(this).find(".open-icon").hide(); 141 $(this).find(".close-icon").show(); 142 $(this).children(".gnb-2dep").slideUp(400); 143 } 144 }); 145 $(this).parent("li").addClass("active"); 146 $(this).children(".close-icon").hide(); 147 $(this).children(".open-icon").show(); 148 $(this).siblings(".gnb-2dep").slideDown(400); 149 } 150 return false;
151 }); 152 153 // í´ë¹íì´ì§ì GNB 모ë°ì¼ 2depth ì´ê¸° & ON 154 if ( dep1> 0 && dep2> 0 ) { 155 $("#navigation > li").eq(dep1-1).addClass("active").children(".gnb-2dep").show().children("li").eq(dep2-1).addClass("on"); 156 } 157 158 // íìë©ë´ê° ìë full style ë©ë´ 159 if ( ( $(".gnb-style-full").length > 0 ) && ( $(".member-menu-box").length > 0 ) ) { 160 $(".gnb-style-full").addClass("gnb-style-full-member"); 161 } 162}); 163 164 165/* *********************** Sub ê³µíµ ************************ */ 166// ì´ì íì´ì§,ë¤ìíì´ì§ ë§í¬ê±¸ê¸° ( 2depth ì´ë ) 167function checkPrevNextLink () { 168 var $sub_prev_page_btn = $(".sub-prev-page-btn"); 169 var $sub_next_page_btn = $(".sub-next-page-btn"); 170 var $dep1_menu = $("#gnb > ul > li"); 171 var dep1_menu_lang = $dep1_menu.length; 172 173 $sub_prev_page_btn.attr("href",$dep1_menu.eq(dep1-2).children("a").attr("href")); 174 $sub_next_page_btn.attr("href",$dep1_menu.eq(dep1).children("a").attr("href")); 175 176 $sub_prev_page_btn.find(".sub-page-name").text($dep1_menu.eq(dep1-2).children("a").text()); 177 $sub_next_page_btn.find(".sub-page-name").text($dep1_menu.eq(dep1).children("a").text()); 178 179 if ( dep1 == dep1_menu_lang ) { 180 $sub_next_page_btn.attr("href",$dep1_menu.eq(0).children("a").attr("href")); 181 $sub_next_page_btn.find(".sub-page-name").text($dep1_menu.eq(0).children("a").text()); 182 }else if ( dep1 == 1 ) { 183 $sub_prev_page_btn.attr("href",$dep1_menu.eq(dep1_menu_lang-1).children("a").attr("href")); 184 $sub_prev_page_btn.find(".sub-page-name").text($dep1_menu.eq(dep1_menu_lang-1).children("a").text()); 185 } 186} 187 188$(window).load(function () { 189 checkPrevNextLink(); 190}); 191 192$(document).ready(function () { 193 // ìë¸ë©ë´ìì í´ë¹ë©ë´ on 194 if ( dep1 > 0 && dep2 > 0) { 195 $gnbList.children("li").eq(dep1-1).addClass("active"); 196 $gnbMList.eq(dep1-1).addClass("on"); 197 $snb.each(function () { 198 $(this).find("li").eq(dep2-1).addClass("on"); 199 }); 200 } 201 202 // ìë¸ ìë¨ location (1ì°¨, 2ì°¨) íìë©ë´ ON 203 $snbMenu.find(".menu-location").each(function () { 204 // 2depth ON 205 if ( $(this).is(".location1") ) { 206 $(this).find(".location-menu-con").children("li").eq(dep1-1).addClass("on"); 207 }else { 208 $(this).find(".location-menu-con").children("li").eq(dep2-1).addClass("on"); 209 } 210 }); 211}); 212
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.