从一页移动到另一页时,导航菜单会闪烁,仅在 Chrome
Navigation menu flickers when moving from page to page, only in Chrome
我在创建的网站上遇到问题。当您从一个页面移动到另一个页面时,导航菜单会闪烁,但仅在 Chrome 和 IE 中。
更奇怪的是,当我在 Chrome 上以 icognito window 打开它或在本地加载它时,它不会发生。
这是一个活生生的例子 - http://andrewbruce.me
我将代码放在下面 -
导航HTML -
<body>
<div class="menuButton" onclick="decide(this);">
<div id = "bar1"></div>
<div id = "bar2"></div>
<div id = "bar3"></div>
</div>
<div id ="nav">
<ul>
<a href = "home.html"><li>HOME<span style = "float: right; padding-right: 2%;">></span></li><a/>
<a href = "portfolio.html"><li>PORTFOLIO<span style = "float: right; padding-right: 2%;">></span></li><a/>
<a href = "cv.html"><li>CV<span style = "float: right; padding-right: 2%;>></span></li><a/>
<a href = "contact.html"><li>CONTACT<span style = "float: right; padding-right: 2%;">></span></li><a/>
</ul>
</div>
导航CSS-
#nav {
height: 100%;
width: 22%;
text-align: center;
box-shadow: 2px 2px 5px #888888;
transition: all .3s ease-in-out;
background-color: #1b1d1f;
float: left;
position: fixed;
z-index: 2;
}
#nav ul {
display: inline-block;
margin: 0;
padding: 0;
list-style: none;
width: 100%;
line-height: 2;
margin-top: 20%;
}
#nav a {
text-decoration: none;
}
#nav li {
transition: all .2s ease-in-out;
color: white;
font-size: 25px;
text-align: left;
padding-left: 15px;
}
我已经在 Chrome 和 Safari 中测试了您的网站,但我似乎无法重现闪烁。闪烁可能是由于加载速度和导航栏刚刚加载。基于它只发生在 public 服务器上的事实。当您进行本地测试时,速度往往是即时的,因为它是直接从您计算机上的文件中提取的。
我明白了。我安装了一个 Chrome 扩展程序,它降低了我的浏览器的性能,因此它加载导航栏的速度很慢。
因此它在隐身模式下工作的原因是 none 的扩展程序正在加载!
我在创建的网站上遇到问题。当您从一个页面移动到另一个页面时,导航菜单会闪烁,但仅在 Chrome 和 IE 中。
更奇怪的是,当我在 Chrome 上以 icognito window 打开它或在本地加载它时,它不会发生。
这是一个活生生的例子 - http://andrewbruce.me
我将代码放在下面 -
导航HTML -
<body>
<div class="menuButton" onclick="decide(this);">
<div id = "bar1"></div>
<div id = "bar2"></div>
<div id = "bar3"></div>
</div>
<div id ="nav">
<ul>
<a href = "home.html"><li>HOME<span style = "float: right; padding-right: 2%;">></span></li><a/>
<a href = "portfolio.html"><li>PORTFOLIO<span style = "float: right; padding-right: 2%;">></span></li><a/>
<a href = "cv.html"><li>CV<span style = "float: right; padding-right: 2%;>></span></li><a/>
<a href = "contact.html"><li>CONTACT<span style = "float: right; padding-right: 2%;">></span></li><a/>
</ul>
</div>
导航CSS-
#nav {
height: 100%;
width: 22%;
text-align: center;
box-shadow: 2px 2px 5px #888888;
transition: all .3s ease-in-out;
background-color: #1b1d1f;
float: left;
position: fixed;
z-index: 2;
}
#nav ul {
display: inline-block;
margin: 0;
padding: 0;
list-style: none;
width: 100%;
line-height: 2;
margin-top: 20%;
}
#nav a {
text-decoration: none;
}
#nav li {
transition: all .2s ease-in-out;
color: white;
font-size: 25px;
text-align: left;
padding-left: 15px;
}
我已经在 Chrome 和 Safari 中测试了您的网站,但我似乎无法重现闪烁。闪烁可能是由于加载速度和导航栏刚刚加载。基于它只发生在 public 服务器上的事实。当您进行本地测试时,速度往往是即时的,因为它是直接从您计算机上的文件中提取的。
我明白了。我安装了一个 Chrome 扩展程序,它降低了我的浏览器的性能,因此它加载导航栏的速度很慢。
因此它在隐身模式下工作的原因是 none 的扩展程序正在加载!