Skip to content

Commit

Permalink
added scrolledin check for items > window height
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam committed May 25, 2020
1 parent 843c208 commit 3192b52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/scroll-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ var ScrollHint = function () {
if (scrolledIn) {
return;
}
if ((0, _util.getOffset)(element).top + element.offsetHeight / 2 < (0, _util.getScrollTop)() + window.innerHeight) {
if ((0, _util.getOffset)(element).top + Math.min(element.offsetHeight, window.innerHeight) / 2 < (0, _util.getScrollTop)() + window.innerHeight) {
item.scrolledIn = true;
if (this.opt.remainingTime !== -1) {
setTimeout(function () {
Expand Down Expand Up @@ -296,4 +296,4 @@ var getOffset = exports.getOffset = function getOffset(el) {
};

},{}]},{},[2])(2)
});
});
2 changes: 1 addition & 1 deletion js/scroll-hint.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3192b52

Please sign in to comment.