Skip to content

Commit 083b99c

Browse files
committed
Makes clones share the size of the original ones
Avoids some odd sizing issues when the original objects do not have a specific width set.
1 parent 0b68de8 commit 083b99c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jquery.swap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
from.css("opacity", 0);
4040
dest.css("opacity", 0);
4141

42-
from_clone.insertAfter(from).css("position", "absolute").offset(from_pos).css("z-index", "999")
43-
dest_clone.insertAfter(dest).css("position", "absolute").offset(dest_pos).css("z-index", "999")
42+
from_clone.insertAfter(from).css({position: "absolute", width: from.outerWidth(), height: from.outerHeight()}).offset(from_pos).css("z-index", "999")
43+
dest_clone.insertAfter(dest).css({position: "absolute", width: dest.outerWidth(), height: dest.outerHeight()}).offset(dest_pos).css("z-index", "999")
4444

4545
if(from_pos.top != dest_pos.top)
4646
route_from_vertical = total_route_vertical - from.height()
@@ -71,4 +71,4 @@
7171

7272
return from;
7373
}
74-
})( jQuery );
74+
})( jQuery );

0 commit comments

Comments
 (0)