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 => {