简体   繁体   English

如何阻止我的汉堡包图标停留在顶部栏上,使其出现在侧面菜单中?

[英]How do I stop my hamburger icon from staying with top bar so it appears with the side menu?

.hamburger

stays with my top bar which is hidden if I change the z-index, how do I stop this from happening? 停留在我的顶部栏(如果更改z-index会隐藏),如何阻止这种情况发生?

https://jsfiddle.net/g3nn0cvy https://jsfiddle.net/g3nn0cvy

Assuming you want the topbar to be hidden when the menu is open, and have the hamburger appear on top of the menu while it is open. 假设您希望在菜单打开时隐藏顶部栏,并在打开菜单时使汉堡包出现在菜单顶部。

Use css visibility: hidden on your #heading , and set visibility: visible on your .hamburger , don't change z-indexes. 使用CSS visibility: hidden#heading ,并设置visibility: visible.hamburger visibility: visible ,不要更改z索引。

I have updated your fiddle with an example 我用一个例子更新了你的小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM