Skip to content

Instantly share code, notes, and snippets.

@balupton
Created February 1, 2011 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balupton/805639 to your computer and use it in GitHub Desktop.
Save balupton/805639 to your computer and use it in GitHub Desktop.
Flash a Element Three Times - Great for validation and drawing attention
/**
* Flash a Element Three Times
* Great for validation and drawing attention
* @author Benjamin Arthur Lupton
* @license Public Domain
*/
$.fn.flash = $.fn.flash||function(){
var $el = $(this);
var a = 0.2, b = 0.8, c = 200;
$el
.animate({opacity:a},c)
.animate({opacity:b},c)
.animate({opacity:a},c)
.animate({opacity:b},c)
.animate({opacity:a},c)
.animate({opacity:1.0},500);
return $el;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment