兼容header
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 4s

This commit is contained in:
2026-04-10 15:18:53 +08:00
parent 9748a3008e
commit 93a72c7826
11 changed files with 57 additions and 429 deletions

View File

@@ -1,7 +1,7 @@
<link rel="stylesheet" href="__CSS__/header.css">
<div class="header">
<div class="header" >
<!-- 导航外容器1920px宽下拉框基于此定位 -->
<div class="header-nav-outer">
<div class="header-nav-outer" >
<!-- 顶部导航栏 -->
<div class="header-nav-bar">
<div style="display:flex;align-items:center">
@@ -184,7 +184,36 @@
</div>
</div>
</div>
<div style="width: 100vw;height: 64px;"></div>
<script>
//产品列表在hover复位tabs选择
const productNavContainer = document.querySelector('.header-nav-item:first-child');
if (productNavContainer) {
productNavContainer.addEventListener('mouseleave', () => {
// 延迟执行,确保下拉菜单已经隐藏
setTimeout(() => {
const tabs = document.querySelectorAll('.header-tab-item');
const contents = document.querySelectorAll('.header-tab-content');
// 重置到第一个tab
if (tabs.length > 0 && tabs[0]) {
tabs.forEach(tab => tab.classList.remove('active'));
contents.forEach(content => content.classList.remove('active'));
tabs[0].classList.add('active');
const firstContentId = tabs[0].getAttribute('data-tab');
const firstContent = document.getElementById(firstContentId);
if (firstContent) firstContent.classList.add('active');
}
}, 350);
});
}
const tabItems = document.querySelectorAll('.header-tab-item');
const tabContents = document.querySelectorAll('.header-tab-content');