PluginProbe
RSVP and Event Management / 1.3.0
RSVP and Event Management v1.3.0
trunk 0.5.0 0.6.0 0.7.0 0.8.0 0.9.0 0.9.5 1.0.0 1.1.0 1.2.0 1.2.1 1.3.0 1.3.1 1.3.2 1.5.0 1.6.0 1.6.1 1.6.2 1.6.5 1.7.0 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 All 136 releases
rsvp / jquery-ui-1.7.2.custom / development-bundle / ui / effects.pulsate.js

effects.pulsate.js in RSVP and Event Management 1.3.0, at jquery-ui-1.7.2.custom/development-bundle/ui/effects.pulsate.js

57 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * jQuery UI Effects Pulsate 1.7.2
3 *
4 * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
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 var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
26
27 // Adjust
28 if (mode == 'hide') times--;
29 if (el.is(':hidden')) { // Show fadeIn
30 el.css('opacity', 0);
31 el.show(); // Show
32 el.animate({opacity: 1}, duration, o.options.easing);
33 times = times-2;
34 }
35
36 // Animate
37 for (var i = 0; i < times; i++) { // Pulsate
38 el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing);
39 };
40 if (mode == 'hide') { // Last Pulse
41 el.animate({opacity: 0}, duration, o.options.easing, function(){
42 el.hide(); // Hide
43 if(o.callback) o.callback.apply(this, arguments); // Callback
44 });
45 } else {
46 el.animate({opacity: 0}, duration, o.options.easing).animate({opacity: 1}, duration, o.options.easing, function(){
47 if(o.callback) o.callback.apply(this, arguments); // Callback
48 });
49 };
50 el.queue('fx', function() { el.dequeue(); });
51 el.dequeue();
52 });
53
54 };
55
56 })(jQuery);
57