comparison war/scripts/jQuery/ui/jquery.effects.pulsate.js @ 3:cf06b77a8bbd

Committed branch of the e4D repos sti-gwt branch 16384. git-svn-id: http://dev.dariah.eu/svn/repos/eu.dariah.de/ap1/sti-gwt-dariah-geobrowser@36 f2b5be40-def6-11e0-8a09-b3c1cc336c6b
author StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
date Tue, 17 Jul 2012 13:34:40 +0000
parents
children
comparison
equal deleted inserted replaced
2:2897af43ccc6 3:cf06b77a8bbd
1 /*
2 * jQuery UI Effects Pulsate 1.8.14
3 *
4 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5 * Dual licensed under the MIT or GPL Version 2 licenses.
6 * http://jquery.org/license
7 *
8 * http://docs.jquery.com/UI/Effects/Pulsate
9 *
10 * Depends:
11 * jquery.effects.core.js
12 */
13 (function( $, undefined ) {
14
15 $.effects.pulsate = function(o) {
16 return this.queue(function() {
17 var elem = $(this),
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'),
22 animateTo = 0;
23
24 if (!isVisible) {
25 elem.css('opacity', 0).show();
26 animateTo = 1;
27 }
28
29 if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {
30 times--;
31 }
32
33 for (var i = 0; i < times; i++) {
34 elem.animate({ opacity: animateTo }, duration, o.options.easing);
35 animateTo = (animateTo + 1) % 2;
36 }
37
38 elem.animate({ opacity: animateTo }, duration, o.options.easing, function() {
39 if (animateTo == 0) {
40 elem.hide();
41 }
42 (o.callback && o.callback.apply(this, arguments));
43 });
44
45 elem
46 .queue('fx', function() { elem.dequeue(); })
47 .dequeue();
48 });
49 };
50
51 })(jQuery);