問題描述
我正在為我正在發(fā)布的 Android 應(yīng)用程序開發(fā)一個小型網(wǎng)站,但我有一個小問題,我似乎無法找到答案.
I am working on a small website for an Android App I'm releasing, but I have a small problem that I can't seem to find the answer to.
在 Firefox 中,一切正常,但是當(dāng)您滾動然后單擊導(dǎo)航鏈接(只需使用 id 向下移動頁面)但在 Chrome 上,導(dǎo)航會消失,直到您再滾動一些.
In Firefox, everything works properly but when you scroll and then click on a nav link (simply using an id to move down the page) but on Chrome, the navigation disappears until you scroll some more.
網(wǎng)站上線了www.ioudebtcalculator.com
這些是我應(yīng)用的唯一樣式:
These are the only styles I have applied:
#navBar {
background-color:#000;
position:fixed;
width:100%;
font-family:sans-serif;
font-weight:bold;
font-size:13pt;
height:70px;
}
我已經(jīng)從網(wǎng)站上的導(dǎo)航欄中刪除了固定位置,因此您將不再看到那里的問題.問題還沒有解決.
I have since removed the position fixed from the navBar on the website so you will no longer see the problem there. The problem has not yet been solved.
您可以使用開發(fā)者工具或任何其他等效工具輕松地將固定位置添加到導(dǎo)航欄元素以查看問題.
You can easily add position fixed to the navBar element using Developer Tools or any other equivalent tool to see the problem.
推薦答案
將它添加到導(dǎo)航欄 css 時(shí)對我有用
it works for me when adding this to your navbar css
-webkit-transform: translateZ(0);
制作
#navBar {
background-color: #000;
width: 100%;
position: fixed;
font-family: sans-serif;
font-weight: bold;
font-size: 14pt;
height: 70px;
-webkit-transform: translateZ(0);
z-index: 1;
box-shadow: 0 2.5px 20px #000;
}
這篇關(guān)于滾動并單擊后,導(dǎo)航在 Chrome 中消失的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!