From 6fad1244a8aa7c06ff9c0fb8d8ff5c8609b51439 Mon Sep 17 00:00:00 2001
From: nanhaoluo <3075912108@qq.com>
Date: Fri, 23 Jan 2026 15:16:50 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4important=E5=B9=B6?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AF=A6=E7=BB=86=E8=B0=83=E8=AF=95=E6=97=A5?=
=?UTF-8?q?=E5=BF=97?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除CSS中的!important,避免叠屎山
- 添加详细的console.log调试信息
- 输出每个卡片的opacity值和loading状态
- 方便通过浏览器控制台定位问题
---
argontheme.js | 19 ++++++++++++++++---
style.css | 12 ++++++------
2 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/argontheme.js b/argontheme.js
index 7a82e07..72a4fce 100644
--- a/argontheme.js
+++ b/argontheme.js
@@ -2831,9 +2831,22 @@ $(document).pjax("a[href]:not([no-pjax]):not(.no-pjax):not([target='_blank']):no
$card.append("
");
$card.addClass("post-pjax-loading");
$("#main").addClass("post-list-pjax-loading");
- console.log("Added post-list-pjax-loading class to #main");
- console.log("Total .post-preview elements:", $(".post-preview").length);
- console.log("Hidden .post-preview elements:", $("#main.post-list-pjax-loading .post-preview").length);
+
+ // 调试信息
+ console.log("=== 文章加载动画调试 ===");
+ console.log("点击的卡片:", $card[0]);
+ console.log("#main 是否有 post-list-pjax-loading 类:", $("#main").hasClass("post-list-pjax-loading"));
+ console.log("页面中 .post-preview 总数:", $(".post-preview").length);
+ console.log("应该隐藏的 .post-preview 数量:", $("#main.post-list-pjax-loading .post-preview").length);
+ console.log("被点击的卡片是否有 post-pjax-loading 类:", $card.hasClass("post-pjax-loading"));
+
+ // 检查CSS是否生效
+ $(".post-preview").each(function(index) {
+ let opacity = $(this).css("opacity");
+ let hasLoadingClass = $(this).hasClass("post-pjax-loading");
+ console.log(`卡片 ${index}: opacity=${opacity}, hasLoadingClass=${hasLoadingClass}`);
+ });
+
let offsetTop = $($card).offset().top - $("#main").offset().top;
if ($("html").hasClass("is-home") && $("html").hasClass("banner-as-cover")){
offsetTop = $($card).offset().top - window.outerHeight * 0.418;
diff --git a/style.css b/style.css
index 8b86218..fdff13f 100644
--- a/style.css
+++ b/style.css
@@ -3873,20 +3873,20 @@ html.filter-grayscale {
}
.post-preview.post-pjax-loading {
- opacity: 1 !important;
+ opacity: 1;
z-index: 10;
position: relative;
}
#main.post-list-pjax-loading .post-preview {
- opacity: 0 !important;
- pointer-events: none !important;
- transition: opacity 0.3s ease !important;
+ opacity: 0;
+ pointer-events: none;
+ transition: opacity 0.3s ease;
}
#main.post-list-pjax-loading .post-preview.post-pjax-loading {
- opacity: 1 !important;
- pointer-events: auto !important;
+ opacity: 1;
+ pointer-events: auto;
}
.post-title {