Skip to content

Commit fbbed34

Browse files
author
itfourp
committed
subtract scrollTop from viewTop and viewBottom; scrollLeft from viewLeft and viewRight on scrollContainer calculation
1 parent 6eaf72f commit fbbed34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jquery.visible.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@
5959
// add offset if scrollContainer was passed
6060
if (scrollContainer) {
6161
var viewOffset = $c.offset();
62-
viewTop += viewOffset.top;
63-
viewBottom += viewOffset.top;
64-
viewLeft += viewOffset.left;
65-
viewRight += viewOffset.left;
62+
viewTop += viewOffset.top - $c.scrollTop();
63+
viewBottom += viewOffset.top - $c.scrollTop();
64+
viewLeft += viewOffset.left - $c.scrollLeft();
65+
viewRight += viewOffset.left - $c.scrollLeft();
6666

6767
}
6868

0 commit comments

Comments
 (0)