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).

This commit is contained in:
Scott González 2009-09-20 21:07:38 +00:00
parent c6990895be
commit 217266fb62

View File

@ -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(' +