Skip to content

Commit 8ba907f

Browse files
committed
Fix calculations when position:relative node has scroll.
1 parent 8aa6ad2 commit 8ba907f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

place.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ define([
172172
}
173173
} else {
174174
var bcr = place.position(ancestor);
175-
top -= bcr.y + parseFloat(cs.borderTopWidth);
176-
side -= bcr.x + parseFloat(cs.borderLeftWidth);
175+
top -= bcr.y + parseFloat(cs.borderTopWidth) - ancestor.scrollTop;
176+
side -= bcr.x + parseFloat(cs.borderLeftWidth) - ancestor.scrollLeft;
177177
}
178178

179179
if (style.top !== top + "px" || style.left !== side + "px" || style.right !== "auto") {

0 commit comments

Comments
 (0)