From c9e0ea75667cb09293bbab965bb6cc305c75c856 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 4 Mar 2014 09:57:31 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=81=EB=8B=A8=20=EB=A9=94=EB=89=B4=20?= =?UTF-8?q?=EC=A0=95=EB=A0=AC=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.menu.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/jquery.menu.js b/js/jquery.menu.js index 01871f471..72c354b99 100644 --- a/js/jquery.menu.js +++ b/js/jquery.menu.js @@ -79,15 +79,22 @@ function menu_rearrange(el) var width = $("#gnb_1dul").width(); var left = w1 = w2 = 0; var idx = $(".gnb_1dli").index(el); + var max_menu_count = 0; for(i=0; i<=idx; i++) { w1 = $(".gnb_1dli:eq("+i+")").outerWidth(); w2 = $(".gnb_2dli > a:eq("+i+")").outerWidth(true); if((left + w2) > width) { - el.removeClass("gnb_1dli_over").addClass("gnb_1dli_over2"); + if(max_menu_count == 0) + max_menu_count = i + 1; } - left += w1; + if(max_menu_count > 0 && (idx + 1) % max_menu_count == 0) { + el.removeClass("gnb_1dli_over").addClass("gnb_1dli_over2"); + left = 0; + } else { + left += w1; + } } } \ No newline at end of file