diff options
author | Sindre Sorhus <sindresorhus@gmail.com> | 2012-04-04 23:30:13 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-04-04 23:30:13 -0400 |
commit | fdf37de77882204cafeba2f10fb5b9915b6e4b93 (patch) | |
tree | 65d5c59749199b5316452f129d2fb886724c72c6 /src | |
parent | d5ee856a44eff3f07162cf7eb1181b58d3a1c6ff (diff) | |
download | jquery-fdf37de77882204cafeba2f10fb5b9915b6e4b93.tar.gz jquery-fdf37de77882204cafeba2f10fb5b9915b6e4b93.zip |
Followup to #11469; add test case and clarify code.
Diffstat (limited to 'src')
-rw-r--r-- | src/effects.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/effects.js b/src/effects.js index e154d2bd4..24d3d34a8 100644 --- a/src/effects.js +++ b/src/effects.js @@ -4,6 +4,7 @@ var elemdisplay = {}, iframe, iframeDoc, rfxtypes = /^(?:toggle|show|hide)$/, rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i, + rMarginProp = /^margin/, timerId, fxAttrs = [ // height animations @@ -636,8 +637,8 @@ jQuery.extend( jQuery.fx, { // Ensure props that can't be negative don't go there on undershoot easing jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) { - // exclude marginTop, marginLeft, marginBottom and marginRight from this list - if ( prop.indexOf( "margin" ) ) { + // Exclude marginTop, marginLeft, marginBottom and marginRight from this list + if ( !rMarginProp.test( prop ) ) { jQuery.fx.step[ prop ] = function( fx ) { jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); }; |