我正在研究我的新投資組合,但我在懸停鏈接以顯示設置爲固定位置的背景圖像時出現文本顏色更改的問題。爲什麼在懸停期間鏈接的文本顏色會發生變化?
在Chrome上一切看起來不錯,但在Safari(v9.1.3)中測試它時,顏色會發生變化。
有誰知道發生了什麼事? 感謝您的幫助
你可以看到源住在這裏: http://diegofria.com/test/new/index.html
HTML
<ul title="drag me, too" class="small-links">
<li id="monocle"><a href="pages/monocle.html">Monocle</li>
<li id="stutterheim"><a href="pages/stutterheim.html">Stutterheim</a></li>
<li id="dagmar"><a href="pages/dagmar.html">House of Dagmar</a></li>
<li id="reschia"><a href="pages/reschia.html" >Reschia</a></li>
<li id="freya"><a href="pages/freya.html">Architect's portfolio</a></li>
</ul>
jQuery的
$("#monocle").hover(
function() {
$('body').css("background", 'url(images/monocle.jpg) no-repeat fixed center');
},
function() {
$('body').css("background", "#f5f5dc");
}
);
啊!這工作。感謝Alex。 –