aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-06-15 02:15:56 +0000
committerScott González <scott.gonzalez@gmail.com>2009-06-15 02:15:56 +0000
commit2f161c13dee5d2269307e563d4ba43e7c196364f (patch)
tree416fae58109f7e9d3a76040a773fbf6de092951f
parent58b37be5acf86913900b51d92eaa3cbb38b14f91 (diff)
downloadjquery-ui-2f161c13dee5d2269307e563d4ba43e7c196364f.tar.gz
jquery-ui-2f161c13dee5d2269307e563d4ba43e7c196364f.zip
Effects core: Tweaked color animation.
-rw-r--r--ui/effects.core.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/ui/effects.core.js b/ui/effects.core.js
index cc74a1233..92e3f1c27 100644
--- a/ui/effects.core.js
+++ b/ui/effects.core.js
@@ -241,18 +241,17 @@ $.fn.extend({
// override the animation for color styles
$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
'borderRightColor', 'borderTopColor', 'color', 'outlineColor'],
- function(i,attr){
+function(i, attr) {
$.fx.step[attr] = function(fx) {
- if (fx.state == 0) {
- fx.start = getColor( fx.elem, attr );
- fx.end = getRGB( fx.end );
+ if (fx.state === 0) {
+ fx.start = getColor(fx.elem, attr);
+ fx.end = getRGB(fx.end);
}
- fx.elem.style[attr] = "rgb(" + [
- Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0],10), 255), 0),
- Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1],10), 255), 0),
- Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2],10), 255), 0)
- ].join(",") + ")";
+ fx.elem.style[attr] = 'rgb(' +
+ Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +
+ Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +
+ Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';
};
});