@@ -117,9 +117,7 @@ $.effects.effect.size = function( o, done ) {
117117 scale = o . scale || "both" ,
118118 origin = o . origin || [ "middle" , "center" ] ,
119119 original , baseline , factor ,
120- position = el . css ( "position" ) ,
121- originalVerticalPositioning = el . css ( "bottom" ) !== "auto" ? "bottom" : "top" ;
122- originalHorizontalPositioning = el . css ( "right" ) !== "auto" ? "right" : "left" ;
120+ position = el . css ( "position" ) ;
123121
124122 if ( mode === "show" ) {
125123 el . show ( ) ;
@@ -260,32 +258,19 @@ $.effects.effect.size = function( o, done ) {
260258 left : el . to . left
261259 } ) ;
262260 } else {
263- $ . each ( [ originalVerticalPositioning , originalHorizontalPositioning ] , function ( idx , pos ) {
261+ $ . each ( [ "top" , "left" ] , function ( idx , pos ) {
264262 el . css ( pos , function ( _ , str ) {
265263 var val = parseInt ( str , 10 ) ,
266264 toRef = idx ? el . to . left : el . to . top ,
267265 delta = idx ? el . to . outerWidth - el . from . outerWidth : el . to . outerHeight - el . from . outerHeight ,
268266 same = origin [ idx ] === pos ,
269- mid = origin [ idx ] === "middle" || origin [ idx ] === "center" ,
270- direction = pos == "left" || pos == "top" ;
267+ mid = origin [ idx ] === "middle" || origin [ idx ] === "center" ;
271268
272269 // if original was "auto", recalculate the new value from wrapper
273270 if ( str === "auto" ) {
274271 return toRef + "px" ;
275272 }
276273
277- // if not setting left or top
278- if ( ! direction ) {
279-
280- // if the position is relative, bottom/right are reversed meaning
281- if ( position === "relative" ) {
282- toRef *= - 1 ;
283-
284- // otherwise, if its NOT a midpoint origin, compensate for the outerWidth difference
285- } else if ( ! mid ) {
286- toRef -= delta * ( same ? - 1 : 1 ) ;
287- }
288- }
289274 return val + toRef + "px" ;
290275 } ) ;
291276 } ) ;
0 commit comments