//文字闪烁(ps:obj上不能设置初始颜色,但可以在其父级为其设置初始颜色)
util.textFlash = function(obj,className,times){
var i=0,t=false,o=obj.attr("class")+"",c="",times=times||2;
// console.log(obj.attr("class"));
if (t) return;
t = setInterval(function(){
i++;
c=i%2?className:o;
obj.attr("class",c);
if(i==2*times){
clearInterval(t);
obj.removeClass(className);
}
},200);
}
原文:http://www.cnblogs.com/weimo10235/p/6493132.html