@@ -17,10 +17,14 @@ $.effects.effect.transfer = function( o ) {
17
17
return this . queue ( function ( ) {
18
18
var elem = $ ( this ) ,
19
19
target = $ ( o . to ) ,
20
+ targetFixed = target . css ( "position" ) === "fixed" ,
21
+ body = $ ( "body" ) ,
22
+ fixTop = targetFixed ? body . scrollTop ( ) : 0 ,
23
+ fixLeft = targetFixed ? body . scrollLeft ( ) : 0 ,
20
24
endPosition = target . offset ( ) ,
21
25
animation = {
22
- top : endPosition . top ,
23
- left : endPosition . left ,
26
+ top : endPosition . top - fixTop ,
27
+ left : endPosition . left - fixLeft ,
24
28
height : target . innerHeight ( ) ,
25
29
width : target . innerWidth ( )
26
30
} ,
@@ -29,11 +33,11 @@ $.effects.effect.transfer = function( o ) {
29
33
. appendTo ( document . body )
30
34
. addClass ( o . className )
31
35
. css ( {
32
- top : startPosition . top ,
33
- left : startPosition . left ,
36
+ top : startPosition . top - fixTop ,
37
+ left : startPosition . left - fixLeft ,
34
38
height : elem . innerHeight ( ) ,
35
39
width : elem . innerWidth ( ) ,
36
- position : ' absolute'
40
+ position : targetFixed ? "fixed" : " absolute"
37
41
} )
38
42
. animate ( animation , o . duration , o . easing , function ( ) {
39
43
transfer . remove ( ) ;
0 commit comments