From 217266fb62b821e8edc0aeb37428a7370848e060 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Sun, 20 Sep 2009 21:07:38 +0000 Subject: [PATCH] Fixed the initialization of color animations for cases where the first step of the animation doesn't happen in the same millisecond as the call to animate. Fixes #4251 - NaN in color animation (Firefox 3). --- ui/jquery.effects.core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index 2f1d12bd3..700190e67 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -336,9 +336,10 @@ $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i, attr) { $.fx.step[attr] = function(fx) { - if (fx.state === 0) { + if (!fx.colorInit) { fx.start = getColor(fx.elem, attr); fx.end = getRGB(fx.end); + fx.colorInit = true; } fx.elem.style[attr] = 'rgb(' + -- 2.39.5