Skip to content

Commit

Permalink
fixed: when to add top and bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
xch1029 committed Jul 5, 2021
1 parent 0f53fc7 commit 1547175
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/trackScroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default function trackScroll(element, options, callback) {
details.direction = scrollY > lastScrollY ? "down" : "up";
details.distance = Math.abs(scrollY - lastScrollY);
details.isOutOfBounds = scrollY < 0 || scrollY + height > scrollHeight;
details.top = scrollY <= options.offset[details.direction];
details.bottom = scrollY + height >= scrollHeight;
details.top = scrollY <= options.offset.up;
details.bottom = scrollY + height >= scrollHeight - options.offset.down;
details.toleranceExceeded =
details.distance > options.tolerance[details.direction];

Expand Down

0 comments on commit 1547175

Please sign in to comment.