Skip to content

Commit

Permalink
Small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arwid committed Aug 14, 2011
1 parent b82d0a7 commit 1eb59bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion jquery.scrollIntoView.js
Expand Up @@ -38,10 +38,13 @@
// start from the common ancester
var pEl = this.commonAncestor().get(0);

var wH = $(window).height();

// go up parents until we find one that scrolls
while (pEl) {
var pY = pEl.scrollTop, pH = pEl.clientHeight;

if (pH > wH) pH = wH;

if (
// it wiggles?
(pEl.scrollTop != ((pEl.scrollTop += 1) == null || pEl.scrollTop) && (pEl.scrollTop -= 1) != null) ||
Expand Down
2 changes: 1 addition & 1 deletion jquery.scrollIntoView.min.js

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

0 comments on commit 1eb59bc

Please sign in to comment.