jQuery的动画背景颜色没有动画 [英] jQuery animate background color not animating
本文介绍了jQuery的动画背景颜色没有动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
http://jsfiddle.net/leonwho/98mD2/
HTML
<div id="account-setup-guide">
<div id="account_tour_info">
<ul>
<li class="setup_complete"><strong>1</strong> Sync!</li>
</ul>
</div>
</div>
CSS
#account-setup-guide {
position: relative;
margin: 30px 30px 20px 20px;
padding: 20px;
width: auto;
border: 5px solid orange;
background: orange;
}
jQuery的
jQuery
var animateThis = function() {
console.log('run animateThis');
$('#account-setup-guide').stop().animate({backgroundColor: '#ffffff'}, 500);
$('#account-setup-guide').animate({
background: 'white'
}, 500);
}
animateThis();
不知道为什么,这是行不通的,我用两个以上例子的 .animate
,但它不是我目前的jsfiddle测试工作:(
Not sure why this isn't working, I've used both examples above of the .animate
but it's not working in my current jsfiddle test :(
推荐答案
jQuery的不支持彩色的动画,你必须包括插件,它支持它 jQuery UI的
或 jQuery的颜色
:
jQuery doesn't support animation of color, you have to include plugin which support it as jQuery UI
or jQuery color
:
的jsfiddle (感谢KEI)
这篇关于jQuery的动画背景颜色没有动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文