2
* jQuery UI Effects Pulsate @VERSION
4
* Copyright (c) 2008 Aaron Eisenberger (aaronchi@gmail.com)
5
* Dual licensed under the MIT (MIT-LICENSE.txt)
6
* and GPL (GPL-LICENSE.txt) licenses.
8
* http://docs.jquery.com/UI/Effects/Pulsate
15
$.effects.pulsate = function(o) {
17
return this.queue(function() {
23
var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
24
var times = o.options.times || 5; // Default # of times
27
if (mode == 'hide') times--;
28
if (el.is(':hidden')) { // Show fadeIn
31
el.animate({opacity: 1}, o.duration / 2, o.options.easing);
36
for (var i = 0; i < times; i++) { // Pulsate
37
el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing);
39
if (mode == 'hide') { // Last Pulse
40
el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){
42
if(o.callback) o.callback.apply(this, arguments); // Callback
45
el.animate({opacity: 0}, o.duration / 2, o.options.easing).animate({opacity: 1}, o.duration / 2, o.options.easing, function(){
46
if(o.callback) o.callback.apply(this, arguments); // Callback
49
el.queue('fx', function() { el.dequeue(); });