【发布时间】:2011-04-03 22:53:19
【问题描述】:
我有一个动画功能...
函数 flashGreen(e) { backg = e.css('backgroundColor'); e.animate({ backgroundColor: "#5ccc96" }, 1000); e.animate({ backgroundColor: backg }, 500); }像这样的css
。容器 { 填充:5px; 背景:#eaeaea; } .containerr:悬停{ 边框:1px #558ecb 实心; 背景:#7dcdf2; 填充:4px; }在我调用 flashGreen 函数之前,悬停可以正常工作,但是在我调用该函数之后,背景颜色不再改变,但边框仍然出现。
发生了什么事?我注意到 jQuery 在 animate 函数之后使用 backgroundColor 在我的 div 中添加了一个“样式”属性。所以我认为“风格”正在覆盖类属性。
在 backgroundColor 上调用 animate 后,如何让我的背景颜色悬停工作。
【问题讨论】: