The example in this article describes how jquery makes the specified element flash. Share it with everyone for your reference. The details are as follows:
This jQuery code is very simple. Its function is to make the specified element continuously change color and flash. The call is also very simple.
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 );
I hope this article will be helpful to everyone’s jQuery programming.