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 {