2 * jQuery UI Effects Pulsate 1.8.24
4 * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
5 * Dual licensed under the MIT or GPL Version 2 licenses.
6 * http://jquery.org/license
8 * http://docs.jquery.com/UI/Effects/Pulsate
11 * jquery.effects.core.js
13 (function( $, undefined ) {
15 $.effects.pulsate = function(o) {
16 return this.queue(function() {
18 mode = $.effects.setMode(elem, o.options.mode || 'show'),
19 times = ((o.options.times || 5) * 2) - 1,
20 duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,
21 isVisible = elem.is(':visible'),
25 elem.css('opacity', 0).show();
29 if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {
33 for (var i = 0; i < times; i++) {
34 elem.animate({ opacity: animateTo }, duration, o.options.easing);
35 animateTo = (animateTo + 1) % 2;
38 elem.animate({ opacity: animateTo }, duration, o.options.easing, function() {
42 (o.callback && o.callback.apply(this, arguments));
46 .queue('fx', function() { elem.dequeue(); })