From 89fdd12dba52e85bfeb455483929800e99f78225 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Wed, 18 Mar 2026 19:36:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E8=88=AA=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=9C=A8=E9=BC=A0=E6=A0=87=E4=BB=8E=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E7=A7=BB=E5=87=BA=E6=97=B6=E4=B8=8D=E6=94=B6=E8=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 原因: .nav-cont 是 width:100% 全屏,左右移出仍在容器内 - 修复: 监听 .nav-shadow(最外层容器)的 mouseleave 从任意方向离开导航区域都会触发收起 --- common/common.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/common.js b/common/common.js index bc7e592..140b743 100644 --- a/common/common.js +++ b/common/common.js @@ -222,6 +222,20 @@ $(function () { } ); + // 当鼠标离开整个导航区域(包括下拉面板)时收起 + $(".nav-shadow").on("mouseleave", function () { + if (hoverTimer) { + clearTimeout(hoverTimer); + hoverTimer = null; + } + leaveTimer = setTimeout(() => { + $(".nav-cont").css("height", "0"); + setTimeout(() => { + $(".nav-cont .nav-cont-menu").css("display", "none"); + }, 300); + }, 100); + }); + if (localStorage.jwt) { if (sessionStorage.accountInfo) { const obj = JSON.parse(sessionStorage.accountInfo);