aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-03-01 22:31:17 -0500
committerDave Methvin <dave.methvin@gmail.com>2012-03-01 22:31:17 -0500
commit56426261f0ee97d6d2f903d08b137a6f5f2c0916 (patch)
tree9f3af82e3373b895ba58a846cb8c5a62e6852ebf /src
parenta52391aa1dcf3f28306e274e1b2d7f0affc4e725 (diff)
downloadjquery-56426261f0ee97d6d2f903d08b137a6f5f2c0916.tar.gz
jquery-56426261f0ee97d6d2f903d08b137a6f5f2c0916.zip
Fix #11415: Stop non-negative prop undershoot on animation.
This doesn't fix *all* of them (see the ticket for a supposedly complete list) but these were already handy so it was relatively cheap to fix them. If you need others fixed, add a custom step function as was done here. Thanks @scott_gonzalez!
Diffstat (limited to 'src')
-rw-r--r--src/effects.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/effects.js b/src/effects.js
index 1536d2d8e..790a63c8e 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -634,9 +634,8 @@ jQuery.extend( jQuery.fx, {
}
});
-// Adds width/height step functions
-// Do not set anything below 0
-jQuery.each([ "width", "height" ], function( i, prop ) {
+// Ensure props that can't be negative don't go there on undershoot easing
+jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
jQuery.fx.step[ prop ] = function( fx ) {
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
};