From 2645649e0d1a7b73750eba17b8b4196b845ce02f Mon Sep 17 00:00:00 2001 From: bohung Date: Thu, 27 Oct 2022 20:02:01 +0800 Subject: [PATCH] Fix bug. --- assets/javascripts/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/app.js b/assets/javascripts/app.js index 8a8a2d4..9c727f3 100644 --- a/assets/javascripts/app.js +++ b/assets/javascripts/app.js @@ -14,11 +14,15 @@ } } // 初始函數: 把所有的程式碼都包在init裡面,方便在之後的jQuery ready 函數裡一次呼叫 - function adjust_logo_font_size(){ + function adjust_logo_font_size(reset_flag){ $('.navbar-header').each(function(i, v){ var $v = $(v); var max_width = $v.width(); var logo_container = $v.find('a'); + if(reset_flag){ + logo_container.css('font-size', '1.2em'); + logo_container.data('font-size', 1.2); + } var logo_width = logo_container.width(); var org_font_size = logo_container.data('font-size'); if(!org_font_size){ @@ -444,7 +448,7 @@ adjust_logo_font_size(); // 自適應網頁使用,當使用者改變瀏覽器寬度時呼叫orbit.nav.setDropdown函數 $(window).resize(function() { - adjust_logo_font_size(); + adjust_logo_font_size(true); if ($(window).width() < 769) { if (resizeTimer) clearTimeout(resizeTimer); $('.outdropdowns').before($('.header-nav'));