我这里有一个有效的淡入/淡出 jQuery 示例: http://jsfiddle.net/mcgarriers/NJe63/6/
不过,我想知道是否可以用背景图片替换background-color red effect?
非常感谢任何指点
最佳答案
尝试这样的事情怎么样?
我更改了您的 jsfiddle 链接中的代码。
$('.box').mouseenter(function(){
$(this).stop().animate({opacity: 0}, 0).css('background', 'url(http://static.tvtropes.org/pmwiki/pub/images/Hello_Kitty_Pink_2981.jpg)').animate({ opacity: 1 }, 1000);
}).mouseleave(function(){
$(this).stop().animate({opacity: 1}, 0).css('background', 'white');
});
关于javascript - 在 jQuery 动画效果中用背景图像替换背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12149893/