jquery.animate()没有backgrundColor的渐变动画,找到一个jquery.color.js插件。
jquery.color.js 下载:http://pan.baidu.com/s/1pJ2Wi7L 密码:oe1r
用法:
$(function(){
var timer1=setInterval(function(){
$('#div1').append("<div id='newC' style='width:300px; height:30px;'>我是新增的</div>")
$('#newC').stop(false, true).animate({backgroundColor:'#F00'}, 500).animate({backgroundColor:'#FFF'}, 500)
$('#newC').removeAttr('id');
},2000);
$('#cancel').click(function(){
clearInterval(timer1);
});
});
简单的实现了,新增数据的背景闪烁渐变的效果,已达到提醒哪条数据是新增的。