This commit is contained in:
@@ -189,28 +189,28 @@
|
|||||||
|
|
||||||
|
|
||||||
//产品列表在hover复位tabs选择
|
//产品列表在hover复位tabs选择
|
||||||
// const productNavContainer = document.querySelector('.header-nav-item:first-child');
|
const productNavContainer = document.querySelector('.header-nav-item:first-child');
|
||||||
|
|
||||||
// if (productNavContainer) {
|
if (productNavContainer) {
|
||||||
// productNavContainer.addEventListener('mouseleave', () => {
|
productNavContainer.addEventListener('mouseleave', () => {
|
||||||
// // 延迟执行,确保下拉菜单已经隐藏
|
// 延迟执行,确保下拉菜单已经隐藏
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
// const tabs = document.querySelectorAll('.header-tab-item');
|
const tabs = document.querySelectorAll('.header-tab-item');
|
||||||
// const contents = document.querySelectorAll('.header-tab-content');
|
const contents = document.querySelectorAll('.header-tab-content');
|
||||||
|
|
||||||
// // 重置到第一个tab
|
// 重置到第一个tab
|
||||||
// if (tabs.length > 0 && tabs[0]) {
|
if (tabs.length > 0 && tabs[0]) {
|
||||||
// tabs.forEach(tab => tab.classList.remove('active'));
|
tabs.forEach(tab => tab.classList.remove('active'));
|
||||||
// contents.forEach(content => content.classList.remove('active'));
|
contents.forEach(content => content.classList.remove('active'));
|
||||||
|
|
||||||
// tabs[0].classList.add('active');
|
tabs[0].classList.add('active');
|
||||||
// const firstContentId = tabs[0].getAttribute('data-tab');
|
const firstContentId = tabs[0].getAttribute('data-tab');
|
||||||
// const firstContent = document.getElementById(firstContentId);
|
const firstContent = document.getElementById(firstContentId);
|
||||||
// if (firstContent) firstContent.classList.add('active');
|
if (firstContent) firstContent.classList.add('active');
|
||||||
// }
|
}
|
||||||
// }, 350);
|
}, 350);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user