color = $.css( elem, attr );
// Keep going until we find an element that has color, or we hit the body
- if ( color !== '' && color !== 'transparent' || $.nodeName( elem, 'body' ) ) {
+ if ( color !== '' && color !== 'transparent' || elem.nodeName.toLowerCase() === 'body' ) {
break;
}
}
// We override the animation for all of these color styles
- $.each( [
+ [
'backgroundColor',
'borderBottomColor',
'borderLeftColor',
'borderTopColor',
'color',
'outlineColor'
- ], function ( i, attr ) {
+ ].forEach( function ( attr ) {
$.fx.step[ attr ] = function ( fx ) {
if ( !fx.colorInit ) {
fx.start = getColor( fx.elem, attr );