Created
February 1, 2011 09:42
-
-
Save balupton/805639 to your computer and use it in GitHub Desktop.
Flash a Element Three Times - Great for validation and drawing attention
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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