Skip to content

Commit

Permalink
Don't use fx.state to determine the first iteration of an animation. …
Browse files Browse the repository at this point in the history
…Fixes various problems.
  • Loading branch information
scottgonzalez authored and jeresig committed Feb 2, 2010
1 parent bafa0ba commit a17222c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jquery.color.js
Expand Up @@ -9,9 +9,10 @@
// We override the animation for all of these color styles
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
jQuery.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(" + [
Expand Down

0 comments on commit a17222c

Please sign in to comment.