From 92835d44e4ff99808bafe7e5a46e3a5b25437ab3 Mon Sep 17 00:00:00 2001 From: lkddi Date: Fri, 27 Feb 2026 01:28:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=94=B9=E7=94=A8=20fixed=20=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D=20+=20=E8=A1=A5=E5=9B=9E=E4=B8=A2=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=20@section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - aside 用 position:fixed 固定在右侧,不再依赖 flex/sticky - JS 控制 >= 1024px 显示,窗口缩放自动响应 - 补回被意外删除的 @section('content') --- resources/views/rooms/guide.blade.php | 46 ++++++++++++++++----------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/resources/views/rooms/guide.blade.php b/resources/views/rooms/guide.blade.php index ba38434..155579f 100644 --- a/resources/views/rooms/guide.blade.php +++ b/resources/views/rooms/guide.blade.php @@ -90,10 +90,23 @@ @endphp @section('content') -
+ {{-- 右侧固定导航(fixed 定位,独立于主内容之外) --}} + - {{-- 左侧主内容 --}} -
+
+ +
{{-- 页面标题 --}}
@@ -336,21 +349,7 @@
-
{{-- /flex-1 主内容结束 --}} - - {{-- 右侧固定导航 --}} - +
@section('scripts') @@ -359,8 +358,17 @@ * 滚动时高亮右侧导航当前所在板块 */ (function() { + // 屏幕宽度 >= 1024px 时显示右侧导航 + const aside = document.getElementById('guide-aside'); const nav = document.getElementById('guide-nav'); - if (!nav) return; + if (!aside || !nav) return; + + function checkWidth() { + aside.style.display = window.innerWidth >= 1024 ? 'block' : 'none'; + } + window.addEventListener('resize', checkWidth); + checkWidth(); + const links = nav.querySelectorAll('a'); const sections = []; links.forEach(a => {