@@ -117,9 +117,7 @@ $.effects.effect.size = function( o, done ) {
117
117
scale = o . scale || "both" ,
118
118
origin = o . origin || [ "middle" , "center" ] ,
119
119
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" ) ;
123
121
124
122
if ( mode === "show" ) {
125
123
el . show ( ) ;
@@ -260,32 +258,19 @@ $.effects.effect.size = function( o, done ) {
260
258
left : el . to . left
261
259
} ) ;
262
260
} else {
263
- $ . each ( [ originalVerticalPositioning , originalHorizontalPositioning ] , function ( idx , pos ) {
261
+ $ . each ( [ "top" , "left" ] , function ( idx , pos ) {
264
262
el . css ( pos , function ( _ , str ) {
265
263
var val = parseInt ( str , 10 ) ,
266
264
toRef = idx ? el . to . left : el . to . top ,
267
265
delta = idx ? el . to . outerWidth - el . from . outerWidth : el . to . outerHeight - el . from . outerHeight ,
268
266
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" ;
271
268
272
269
// if original was "auto", recalculate the new value from wrapper
273
270
if ( str === "auto" ) {
274
271
return toRef + "px" ;
275
272
}
276
273
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
- }
289
274
return val + toRef + "px" ;
290
275
} ) ;
291
276
} ) ;
0 commit comments