@@ -17,10 +17,14 @@ $.effects.effect.transfer = function( o ) {
1717 return this . queue ( function ( ) {
1818 var elem = $ ( this ) ,
1919 target = $ ( o . to ) ,
20+ targetFixed = target . css ( "position" ) === "fixed" ,
21+ body = $ ( "body" ) ,
22+ fixTop = targetFixed ? body . scrollTop ( ) : 0 ,
23+ fixLeft = targetFixed ? body . scrollLeft ( ) : 0 ,
2024 endPosition = target . offset ( ) ,
2125 animation = {
22- top : endPosition . top ,
23- left : endPosition . left ,
26+ top : endPosition . top - fixTop ,
27+ left : endPosition . left - fixLeft ,
2428 height : target . innerHeight ( ) ,
2529 width : target . innerWidth ( )
2630 } ,
@@ -29,11 +33,11 @@ $.effects.effect.transfer = function( o ) {
2933 . appendTo ( document . body )
3034 . addClass ( o . className )
3135 . css ( {
32- top : startPosition . top ,
33- left : startPosition . left ,
36+ top : startPosition . top - fixTop ,
37+ left : startPosition . left - fixLeft ,
3438 height : elem . innerHeight ( ) ,
3539 width : elem . innerWidth ( ) ,
36- position : ' absolute'
40+ position : targetFixed ? "fixed" : " absolute"
3741 } )
3842 . animate ( animation , o . duration , o . easing , function ( ) {
3943 transfer . remove ( ) ;
0 commit comments