【发布时间】:2020-03-29 04:46:09
【问题描述】:
不知道为什么,但粘性导航栏可以正常工作,除非我在移动视图中向下滚动。当我单击“菜单单击此处”时,整个导航栏就会消失。
我认为 javascript 函数正在删除粘性类,但我不知道如何解决这个问题。
http://lonestarwebandgraphics.com/
/* Toggle between adding and removing the "responsive" class to bottomnav when the user clicks on the icon */
function myFunction() {
var x = document.getElementById("mybottomnav");
if (x.className === "bottomnav") {
x.className += " responsive";
} else {
x.className = "bottomnav";
}
}
【问题讨论】:
标签: javascript html css navbar sticky