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