Home > Web Front-end > JS Tutorial > jquery method to make specified elements flash and display_jquery

jquery method to make specified elements flash and display_jquery

WBOY
Release: 2016-05-16 16:09:06
Original
1373 people have browsed it

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 );
Copy after login

I hope this article will be helpful to everyone’s jQuery programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template