This commit is contained in:
BoHung Chiu 2022-10-27 20:02:01 +08:00
parent deed5acf95
commit 2645649e0d
1 changed files with 6 additions and 2 deletions

View File

@ -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'));