jQuery.fn.flash = function( color, duration )
{
var current = this.css( 'color' );
this.animate( { color: 'rgb(' + color + ')' }, duration / 2 );
this.animate( { color: current }, duration / 2 );
}
$( '#importantElement' ).flash( '255,0,0', 1000 );
转载于:https://my.oschina.net/sphl520/blog/609303