Make an element to “FLASH” with jQuery

[javascript]
jQuery.fn.flash = function( color, duration )
{
var current = this.css( ‘color’ );
this.animate( { color: ‘rgb(‘ + color + ‘)’ }, duration / 2 );
this.animate( { color: current }, duration / 2 );
}
//Then use the above function as:
$( ‘#importantElement’ ).flash( ‘255,0,0’, 1000 );
[/javascript]

Leave a Reply