2 * jQuery UI Effects Highlight 1.7.1
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.
8 * http://docs.jquery.com/UI/Effects/Highlight
15 $.effects
.highlight = function(o
) {
17 return this.queue(function() {
20 var el
= $(this), props
= ['backgroundImage','backgroundColor','opacity'];
23 var mode
= $.effects
.setMode(el
, o
.options
.mode
|| 'show'); // Set Mode
24 var color
= o
.options
.color
|| "#ffff99"; // Default highlight color
25 var oldColor
= el
.css("backgroundColor");
28 $.effects
.save(el
, props
); el
.show(); // Save & Show
29 el
.css({backgroundImage
: 'none', backgroundColor
: color
}); // Shift
32 var animation
= {backgroundColor
: oldColor
};
33 if (mode
== "hide") animation
['opacity'] = 0;
36 el
.animate(animation
, { queue
: false, duration
: o
.duration
, easing
: o
.options
.easing
, complete: function() {
37 if(mode
== "hide") el
.hide();
38 $.effects
.restore(el
, props
);
39 if (mode
== "show" && $.browser
.msie
) this.style
.removeAttribute('filter');
40 if(o
.callback
) o
.callback
.apply(this, arguments
);