diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-07-28 15:16:20 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-07-28 15:16:20 +0200 |
commit | 5a45f483d73578dd147229d412998bba4a44c35b (patch) | |
tree | 540e9c5ca8502fa0277d072de973a9c676134793 /ui/jquery.effects.highlight.js | |
parent | 5297b7bc4250462213b05ad2763fe99d0f8dedec (diff) | |
parent | 0ba493d3b4f9d6da35cadc499e9f7ebb6adb31b3 (diff) | |
download | jquery-ui-5a45f483d73578dd147229d412998bba4a44c35b.tar.gz jquery-ui-5a45f483d73578dd147229d412998bba4a44c35b.zip |
Merge branch 'master' into widget-delegation
Diffstat (limited to 'ui/jquery.effects.highlight.js')
-rw-r--r-- | ui/jquery.effects.highlight.js | 60 |
1 files changed, 29 insertions, 31 deletions
diff --git a/ui/jquery.effects.highlight.js b/ui/jquery.effects.highlight.js index cd4f0705a..edde845a3 100644 --- a/ui/jquery.effects.highlight.js +++ b/ui/jquery.effects.highlight.js @@ -12,40 +12,38 @@ */ (function( $, undefined ) { -$.effects.effect.highlight = function( o ) { - return this.queue( function() { - var elem = $( this ), - props = [ 'backgroundImage', 'backgroundColor', 'opacity' ], - mode = $.effects.setMode( elem, o.mode || 'show' ), - animation = { - backgroundColor: elem.css( 'backgroundColor' ) - }; +$.effects.effect.highlight = function( o, done ) { + var elem = $( this ), + props = [ "backgroundImage", "backgroundColor", "opacity" ], + mode = $.effects.setMode( elem, o.mode || "show" ), + animation = { + backgroundColor: elem.css( "backgroundColor" ) + }; - if (mode == 'hide') { - animation.opacity = 0; - } + if (mode === "hide") { + animation.opacity = 0; + } - $.effects.save( elem, props ); - - elem - .show() - .css({ - backgroundImage: 'none', - backgroundColor: o.color || '#ffff99' - }) - .animate( animation, { - queue: false, - duration: o.duration, - easing: o.easing, - complete: function() { - (mode == 'hide' && elem.hide()); - $.effects.restore( elem, props ); - (mode == 'show' && !$.support.opacity && this.style.removeAttribute( 'filter' )); - jQuery.isFunction(o.complete) && o.complete.apply(this, arguments); - elem.dequeue(); + $.effects.save( elem, props ); + + elem + .show() + .css({ + backgroundImage: "none", + backgroundColor: o.color || "#ffff99" + }) + .animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + elem.hide(); } - }); - }); + $.effects.restore( elem, props ); + done(); + } + }); }; })(jQuery); |