这段jquery代码非常简单,功能就是让指定的元素不断的变换颜色,闪烁显示,调用也非常简单。
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程序设计有所帮助。
