这里的jQuery代码有什么问题?
<script>$(document).ready(function()
{
$(".a").hover(function()
{
$(this).find('h2.article-title, p.readmore').stop().animate({'color': '#000000'}, 'normal');
$(this).find('img.a').stop().animate({'opacity': '0'}, 'normal');
},function()
{
$(this).find('h2.article-title, p.readmore').stop().animate({'color': '#606060'}, 'normal');
$(this).find('img.a').stop().animate({'opacity': '1'}, 'normal');
});
});</script>不透明动画运行良好--,而不是颜色,当我使用下面的代码时,它是工作的:
$(this).find('h2.article-title, p.readmore').css('color', 'black');发布于 2014-03-22 13:55:14
动画颜色不工作,除非您包括一个动画颜色库。
默认情况下,jQuery 不使用动画颜色。
有几个选项可供选择,jQuery UI还包括彩色动画,但是占用空间很大,如果您只需要颜色动画,就应该避免使用。
https://stackoverflow.com/questions/22578469
复制相似问题