我正在创建一个表,我想突出显示特定的行。用动画去除css类
我这样做是使用:
$this.css('background-color', 'green');
$this.delay(3000).animate({ backgroundColor: $color }, 3000);
$this = the row in question.
$color = the previous row color.
但我想它与一个CSS类工作,所以像这样
$this.addClass('highlight');
类.highlight
只会有一个background-color
。
问题是,我添加类后,我不能background-color
。
如果我使用:
$this.delay(3000).animate({ backgroundColor: $color }, 3000);
它似乎并没有工作,因为它没有覆盖类.highlight本身的background-color
财产。 而我没有看到一种方法来动画removeClass
方法,甚至switchClass
从.highlight
到''
。
有没有什么解决方案,我不想做这个。
在此先感谢。
这可以帮助:HTTP:/ /stackoverflow.com/questions/7302824/animating-addclass-removeclass-with-jquery –