在以下 JQuery 代码中,动画函数不起作用:
$('#current_item').css({'background-color':'#88ff88'}).animate({'background-color' : '#114411'}, 1000);`
谁能帮我找出原因
最佳答案
如果不使用其他插件,您就无法设置背景颜色的动画。来自 jQuery docs :
All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality (For example, width, height, or left can be animated but background-color cannot be, unless the jQuery.Color() plugin is used).
关于javascript - jquery 动画功能不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19721900/