jQuery.fn.flash = function( color, duration ){var current = this.css( "color" );this.animate( { color: "rgb(" + color + ")" }, duration / 2 );this.animate( { color: current }, duration / 2 );}// http://www.jb51.net Then use the above function as:$( "#importantElement" ).flash( "255,0,0", 1000 );希望本文所述对大家的jQuery程序设计有所帮助。