From 659773348f1fca0fb609f92271013f2a087f3247 Mon Sep 17 00:00:00 2001 From: Anton M Date: Mon, 14 Feb 2011 00:37:07 +0100 Subject: [PATCH] Fix breaking test in Chrome. --- src/effects.js | 4 ++-- test/unit/effects.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/effects.js b/src/effects.js index 0b08bc2d..fd832ce4 100644 --- a/src/effects.js +++ b/src/effects.js @@ -189,7 +189,7 @@ jQuery.fn.extend({ if ( parts ) { var end = parseFloat( parts[2] ), - unit = parts[3] || jQuery.cssNumber[ name ] ? "" : "px"; + unit = parts[3] || ( jQuery.cssNumber[ name ] ? "" : "px" ); // We need to compute starting value if ( unit !== "px" ) { @@ -348,7 +348,7 @@ jQuery.fx.prototype = { this.startTime = jQuery.now(); this.start = from; this.end = to; - this.unit = unit || this.unit || jQuery.cssNumber[ this.prop ] ? "" : "px"; + this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" ); this.now = this.start; this.pos = this.state = 0; diff --git a/test/unit/effects.js b/test/unit/effects.js index 7fb1c7d8..a07c076d 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -922,7 +922,7 @@ test("hide hidden elements, with animation (bug #7141)", function() { test("animate unit-less properties (#4966)", 2, function() { stop(); - var div = jQuery( "
" ).appendTo( "body" ); + var div = jQuery( "
" ).appendTo( "#main" ); equal( div.css( "z-index" ), "0", "z-index is 0" ); div.animate({ zIndex: 2 }, function() { equal( div.css( "z-index" ), "2", "z-index is 2" );