Skip to content

Commit 1eb59bc

Browse files
committed
Small fix.
1 parent b82d0a7 commit 1eb59bc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

jquery.scrollIntoView.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@
3838
// start from the common ancester
3939
var pEl = this.commonAncestor().get(0);
4040

41+
var wH = $(window).height();
42+
4143
// go up parents until we find one that scrolls
4244
while (pEl) {
4345
var pY = pEl.scrollTop, pH = pEl.clientHeight;
44-
46+
if (pH > wH) pH = wH;
47+
4548
if (
4649
// it wiggles?
4750
(pEl.scrollTop != ((pEl.scrollTop += 1) == null || pEl.scrollTop) && (pEl.scrollTop -= 1) != null) ||

jquery.scrollIntoView.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)