From 8ff4c21c57af729593da51a66606ba945b5ab1c0 Mon Sep 17 00:00:00 2001 From: yiqiu Date: Sun, 23 Nov 2025 01:08:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9A=84=E5=8F=91=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/index.css | 15 ++++++++++----- js/tools.js | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/css/index.css b/css/index.css index 5d5e069..43e7d3a 100644 --- a/css/index.css +++ b/css/index.css @@ -20,10 +20,10 @@ padding-right: var(--container-padding-x); } -/* 首页 Header 深色玻璃态覆盖 */ +/* 首页 Header 深色玻璃态覆盖 - 确保最高层级 */ #index #header { background: transparent; - z-index: 999; + z-index: 9999 !important; } #index .nav-shadow { @@ -72,12 +72,12 @@ background: rgba(56, 189, 248, 0.1); } -/* 首页下拉菜单优化 */ +/* 首页下拉菜单优化 - 确保高层级 */ #index .nav-cont { background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(148, 163, 184, 0.15); - z-index: 998; + z-index: 9998 !important; } #index .nav-item-box { @@ -1817,7 +1817,12 @@ html { #index .section.banner { background: transparent; position: relative; - z-index: 0; + z-index: 0 !important; +} + +/* banner 整体容器也降到最低 */ +#index .banner-cont { + z-index: 0 !important; } #index .section.service { diff --git a/js/tools.js b/js/tools.js index 170dfdb..e06c783 100644 --- a/js/tools.js +++ b/js/tools.js @@ -1,6 +1,9 @@ $(function () { + console.log('tools.js loaded'); + // 产品详情页的图片预览轮播(仅在存在时初始化) if ($('.gallery-thumbs').length > 0 && $('.gallery-top').length > 0) { + console.log('Initializing gallery swiper'); var galleryThumbs = new Swiper('.gallery-thumbs', { spaceBetween: 10, slidesPerView: 10, @@ -23,6 +26,9 @@ $(function () { // 首页 Banner 轮播(仅在存在时初始化) if ($('.banner-cont').length > 0) { + console.log('Found .banner-cont, initializing banner swiper'); + console.log('Number of slides:', $('.banner-cont .swiper-slide').length); + const mySwiper = new Swiper(".banner-cont", { loop: true, // 循环模式选项 autoplay: { @@ -39,6 +45,7 @@ $(function () { // 监听切换事件,重置进度条动画 on: { slideChange: function () { + console.log('Slide changed'); // 移除所有进度条动画 document.querySelectorAll('.banner-cont .swiper-pagination-bullet').forEach(function(bullet) { bullet.classList.remove('progress-active'); @@ -47,18 +54,28 @@ $(function () { const activeBullet = document.querySelector('.banner-cont .swiper-pagination-bullet-active'); if (activeBullet) { activeBullet.classList.add('progress-active'); + console.log('Added progress-active to bullet'); } }, init: function () { + console.log('Swiper initialized'); + console.log('Pagination bullets:', document.querySelectorAll('.swiper-pagination-bullet').length); // 初始化时给第一个添加进度动画 setTimeout(function() { const activeBullet = document.querySelector('.banner-cont .swiper-pagination-bullet-active'); if (activeBullet) { activeBullet.classList.add('progress-active'); + console.log('Added initial progress-active to bullet'); + } else { + console.log('No active bullet found'); } }, 100); } } }); + + console.log('Banner swiper created:', mySwiper); + } else { + console.log('.banner-cont not found'); } })