Skip to content
Snippets Groups Projects
Commit 3d5e7555 authored by HouTeng Chan's avatar HouTeng Chan
Browse files

Update file menu.html

parent b470952e
No related branches found
No related tags found
No related merge requests found
......@@ -108,18 +108,18 @@
}
.hamburger {
display: block; /* 显示汉堡菜单 */
display: block;
}
.my-navbar {
flex-direction: column;
align-items: flex-start;
display: none; /* 默认隐藏导航菜单 */
display: none;
width: 100%;
}
.my-navbar.show-menu {
display: flex; /* 显示导航菜单 */
display: flex;
}
.my-navbar > li {
......@@ -134,7 +134,7 @@
.my-navbar > li > ul.son {
position: static;
display: none; /* 默认隐藏子菜单 */
display: none;
width: 100%;
opacity: 1;
box-shadow: none;
......@@ -144,7 +144,7 @@
}
.my-navbar > li.show > ul.son {
display: block; /* 显示子菜单 */
display: block;
}
.son li a {
......@@ -248,13 +248,10 @@
}
});
});
// 监听窗口大小变化,重置导航菜单状态
window.addEventListener('resize', function() {
var navbar = document.getElementById('my-navbar');
if(window.innerWidth > 768){
navbar.classList.remove('show-menu');
// 移除所有菜单项的 'show' 类
navItems.forEach(function(item){
item.classList.remove('show');
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment