aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.effects.pulsate.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-03-09 10:01:07 -0500
committerScott González <scott.gonzalez@gmail.com>2011-03-09 10:01:07 -0500
commit3875cf63e4bef49b0da888bc9c8e60b9512cbf60 (patch)
tree42387525b2207be91b9da7060d5d0de5c9b08f9e /ui/jquery.effects.pulsate.js
parentfa7f5d2873b1fef978eab7d9f342c5afa77e061c (diff)
parent74cff5d57ae35ee05bff1138b1833e896997665d (diff)
downloadjquery-ui-3875cf63e4bef49b0da888bc9c8e60b9512cbf60.tar.gz
jquery-ui-3875cf63e4bef49b0da888bc9c8e60b9512cbf60.zip
Merge branch 'effects-api' of https://github.com/gnarf37/jquery-ui into gnarf37-effects-api
Diffstat (limited to 'ui/jquery.effects.pulsate.js')
-rw-r--r--ui/jquery.effects.pulsate.js41
1 files changed, 21 insertions, 20 deletions
diff --git a/ui/jquery.effects.pulsate.js b/ui/jquery.effects.pulsate.js
index 1b3cb00f8..c5f67b12b 100644
--- a/ui/jquery.effects.pulsate.js
+++ b/ui/jquery.effects.pulsate.js
@@ -12,39 +12,40 @@
*/
(function( $, undefined ) {
-$.effects.pulsate = function(o) {
- return this.queue(function() {
- var elem = $(this),
- mode = $.effects.setMode(elem, o.options.mode || 'show'),
- times = ((o.options.times || 5) * 2) - 1,
- duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,
- isVisible = elem.is(':visible'),
- animateTo = 0;
+$.effects.pulsate = function( o ) {
+ return this.queue( function() {
+ var elem = $( this ),
+ mode = $.effects.setMode( elem, o.mode || 'show' ),
+ times = ( ( o.times || 5 ) * 2 ) - 1,
+ duration = o.duration / 2,
+ isVisible = elem.is( ':visible' ),
+ animateTo = 0,
+ i;
- if (!isVisible) {
+ if ( !isVisible ) {
elem.css('opacity', 0).show();
animateTo = 1;
}
- if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {
+ if ( ( mode == 'hide' && isVisible ) || ( mode == 'show' && !isVisible ) ) {
times--;
}
- for (var i = 0; i < times; i++) {
- elem.animate({ opacity: animateTo }, duration, o.options.easing);
- animateTo = (animateTo + 1) % 2;
+ for ( i = 0; i < times; i++ ) {
+ elem.animate({
+ opacity: animateTo
+ }, duration, o.easing );
+ animateTo = ( animateTo + 1 ) % 2;
}
- elem.animate({ opacity: animateTo }, duration, o.options.easing, function() {
+ elem.animate({
+ opacity: animateTo
+ }, duration, o.easing, function() {
if (animateTo == 0) {
elem.hide();
}
- (o.callback && o.callback.apply(this, arguments));
- });
-
- elem
- .queue('fx', function() { elem.dequeue(); })
- .dequeue();
+ (o.complete && o.complete.apply(this, arguments));
+ }).dequeue();
});
};