我试图改变鼠标悬停我的背景图片,图像变化,但该过渡闪烁和淡入/输出似乎不工作...背景图像闪烁鼠标悬停
代码:
CSS :
.background {
position: fixed;
top:100px;
width: 100%;
height: 100%;
background: url(../img/angst.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
JS:
$(".project_link_01")
.mouseover(function() {
$('.background').css('backgroundImage','url(../img/test.png)').fadeIn();
})
.mouseout(function() {
$('.background').css('backgroundImage','url(../img/angst.png)');
});
的闪烁可能会在加载图像,你是拉起来,当鼠标悬停已经发生了可以发生,因为滞后。尝试预加载它们。 – Patel