~jstys-z/helioviewer.org/timeline

« back to all changes in this revision

Viewing changes to lib/jquery/jquery.ui-1.6rc2/ui/effects.pulsate.js

  • Committer: V. Keith Hughitt
  • Date: 2009-03-26 19:20:57 UTC
  • Revision ID: hughitt1@kore-20090326192057-u0x8rf8sf5lmmnwh
nightly build 03-26-2009: Using alpha-channel JPEG 2000 dataset

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * jQuery UI Effects Pulsate @VERSION
3
 
 *
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.
7
 
 * 
8
 
 * http://docs.jquery.com/UI/Effects/Pulsate
9
 
 *
10
 
 * Depends:
11
 
 *      effects.core.js
12
 
 */
13
 
(function($) {
14
 
 
15
 
$.effects.pulsate = function(o) {
16
 
 
17
 
        return this.queue(function() {
18
 
                
19
 
                // Create element
20
 
                var el = $(this);
21
 
                
22
 
                // Set options
23
 
                var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
24
 
                var times = o.options.times || 5; // Default # of times
25
 
                
26
 
                // Adjust
27
 
                if (mode == 'hide') times--;
28
 
                if (el.is(':hidden')) { // Show fadeIn
29
 
                        el.css('opacity', 0);
30
 
                        el.show(); // Show
31
 
                        el.animate({opacity: 1}, o.duration / 2, o.options.easing);
32
 
                        times = times-2;
33
 
                }
34
 
                
35
 
                // Animate
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);
38
 
                };
39
 
                if (mode == 'hide') { // Last Pulse
40
 
                        el.animate({opacity: 0}, o.duration / 2, o.options.easing, function(){
41
 
                                el.hide(); // Hide
42
 
                                if(o.callback) o.callback.apply(this, arguments); // Callback
43
 
                        });
44
 
                } else {
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
47
 
                        });
48
 
                };
49
 
                el.queue('fx', function() { el.dequeue(); });
50
 
                el.dequeue();
51
 
        });
52
 
        
53
 
};
54
 
 
55
 
})(jQuery);