我目前正在爲我的博客製作一個新主題,而且我遇到了標題問題。看,標題在頂部有一個固定的位置,就像一個導航欄,當用戶向下滾動時它會縮小。但是,在某些瀏覽器(主要是Chrome瀏覽器,尤其是Windows)上,標題上的Twitter圖標有一種奇怪的閃爍行爲,會持續十分之一秒左右。在CSS轉換期間閃爍的錯誤
我在使用過渡時看到了很多關於Chrome中閃爍錯誤的東西,但沒有看起來像這樣的東西(另外,修復程序並不適用於我的情況)。 這是圖標邊距和標題高度的簡單轉換。
有沒有人看過類似的東西?
非常感謝!
編輯:重新創建它在小提琴。問題還在這裏:http://jsfiddle.net/PVmgz/
HTML`
<header>
<div class="container header">
<a href="#" title="MangeMonBeat"><div id="logo">Logo</div></a>
<div class="social">
<div class="search icon">
</div>
<div class="facebook icon">
</div>
<div class="twitter icon">
</div>
</div>
</div>
</header>
<div id="button">Scroll</div>
`
CSS
header {
width: 100%;
height: 98px;
background: #EEE;
position: fixed;
top: 0;
z-index: 9999;
-webkit-transition: height, ease-in, 0.4s;
-moz-transition: height, ease-in, 0.4s;
-ms-transition: height, ease-in, 0.4s;
-o-transition: height, ease-in, 0.4s;
transition: height, ease-in, 0.4s;
}
header.scroll {
height: 60px;
}
header.scroll .header #logo {
width: 350px;
height:50px;
}
header.scroll .header .social {
margin-top: -2px;
}
header.scroll .header .social .icon {
margin-left: 2px;
}
.header {
padding: 5px 10px 0;
}
.header #logo {
width: 400px;
height:82px;
background: #696;
color:white;
float: left;
-webkit-transition: width, ease-in, 0.4s;
-moz-transition: width, ease-in, 0.4s;
-ms-transition: width, ease-in, 0.4s;
-o-transition: width, ease-in, 0.4s;
transition: width, ease-in, 0.4s;
}
.header #logo img {
max-width: 100%;
height: auto;
}
.header .social {
float: right;
margin-top: 19px;
-webkit-transition: margin-top, ease-in, 0.4s;
-moz-transition: margin-top, ease-in, 0.4s;
-ms-transition: margin-top, ease-in, 0.4s;
-o-transition: margin-top, ease-in, 0.4s;
transition: margin-top, ease-in, 0.4s;
}
.header .social .icon {
display: inline-block;
margin-left: 20px;
width: 51px;
height: 51px;
border-radius:999px;
-webkit-transition: margin-left, ease-in, 0.4s;
-moz-transition: margin-left, ease-in, 0.4s;
-ms-transition: margin-left, ease-in, 0.4s;
-o-transition: margin-left, ease-in, 0.4s;
transition: margin-left, ease-in, 0.4s;
}
.header .social .icon.facebook {
position: relative;
background:#336699;
}
.header .social .icon.twitter {
position: relative;
background:#66cccc;
}
安置自己的代碼在這裏!這個環節可能在某個時候死亡,這些問題和解決方案必須繼續存在。如果你製作了一個JSFiddle,它也會很好,所以我們可以輕鬆地使用你的代碼來嘗試和幫助你。 – jmeas
當然,一旦我清理乾淨,一分鐘就能完成! – user1537927