From 41df989bdffa43f3eebb1edc5a5c4ffd41310cf0 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Mon, 12 Jan 2026 17:00:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=AE=E5=8A=A8?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=AE=B9=E5=99=A8=E4=B8=8D=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 fabtns-unloaded 添加过渡动画 - 添加 jQuery 和 DOM 加载检查,确保元素存在后再初始化 - 添加重试机制,防止初始化失败 --- argontheme.js | 13 +++++++++++++ style.css | 4 +--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/argontheme.js b/argontheme.js index 5e46a43..d9cc864 100644 --- a/argontheme.js +++ b/argontheme.js @@ -683,7 +683,20 @@ if (argonConfig.waterflow_columns != "1") { /*浮动按钮栏相关 (回顶等)*/ !function(){ + // 确保 DOM 和 jQuery 已加载 + if (typeof jQuery === 'undefined') { + console.warn('jQuery not loaded, retrying...'); + setTimeout(arguments.callee, 50); + return; + } + let $fabtns = $('#float_action_buttons'); + if ($fabtns.length === 0) { + console.warn('Float action buttons not found, retrying...'); + setTimeout(arguments.callee, 50); + return; + } + let $backToTopBtn = $('#fabtn_back_to_top'); let $toggleSidesBtn = $('#fabtn_toggle_sides'); let $toggleDarkmode = $('#fabtn_toggle_darkmode'); diff --git a/style.css b/style.css index e072f16..dad1a88 100644 --- a/style.css +++ b/style.css @@ -3154,11 +3154,9 @@ html.is-home.banner-as-cover #float_action_buttons.hidden { } .fabtns-unloaded { - opacity: 0; - pointer-events: none; - + transition: opacity var(--animation-normal) var(--ease-standard); } .fabtn {