From 970b873f27c1e20e55e95eb9ac71fc6be3263673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=A4=952077?= Date: Fri, 17 Oct 2025 11:41:32 +0800 Subject: [PATCH] Update head-end.html --- layouts/partials/custom/head-end.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/partials/custom/head-end.html b/layouts/partials/custom/head-end.html index fcd5d18..8dc2270 100644 --- a/layouts/partials/custom/head-end.html +++ b/layouts/partials/custom/head-end.html @@ -209,13 +209,13 @@ document.addEventListener('DOMContentLoaded', function() { // --- 主逻辑 --- - // 1. 定义桌面端菜单的选择器 - const desktopMenuSelector = 'ul.hx-flex.hx-flex-col.hx-gap-1.max-md\\:hx-hidden'; + // 1. 定义桌面端菜单的选择器(转义冒号,使 querySelector 能匹配类名中包含冒号的 Tailwind-like 类) + const desktopMenuSelector = 'ul.hx\\:flex.hx\\:flex-col.hx\\:gap-1.hx\\:max-md\\:hidden'; // 2. 定义移动端菜单的选择器 // 通常,移动端菜单的类与桌面端相反(例如,在md及以上屏幕隐藏) // !!! 请根据你的HTML结构检查并确认这个选择器是正确的 !!! - const mobileMenuSelector = 'ul.hx-flex.hx-flex-col.hx-gap-1.md\\:hx-hidden'; + const mobileMenuSelector = 'ul.hx\\:flex.hx\\:flex-col.hx\\:gap-1.hx\\:md\\:hidden'; // 3. 分别为桌面和移动端菜单应用逻辑 applyClickPrevention(desktopMenuSelector, 'Desktop Menu');